Thanks! Well, I don't have control over the xml output, its done as
the output of an sql search. I suppose I could use sed to fix the xml
sheet into something more well behaved. ..

Cheers,
Joe

On Nov 20, 2:36 pm, Cerebrus <[EMAIL PROTECTED]> wrote:
> 1. YourXMLisn't well formed.
> 2. To accurately decode escaped HTML, you would need an extension
> function or you could do it using a template that searches for and
> replaces all occurrences of the required entities.
> 2. Instead of trying to include HTML withinXML, I would rather let it
> contain what it is designed for - storage of data. To elaborate, myXMLwould 
> rather be :
>
> ---
> <?xmlversion="1.0"?>
> <NewDataSet>
>   <Table>
>     <link>http://cas.sdss.org/dr7/en/tools/chart/navi.asp?
> ra=166.358&amp;dec=-0.748596</link>
>  <img>http://casjobs.sdss.org/ImgCutoutDR7/getjpeg.aspx?
> ra=166.358&amp;dec=-0.748596&amp;scale=0.40&amp;width=120&amp;height=120&amp;opt=</
> img>
>     <name>J1105</name>
>     <ra>16.25829</ra>
>     <dec>-7.74849605</dec>
>     <mag_g>18.9</mag_g>
>     <id>587722982270959696</id>
>     <sep>0.02</sep>
>   </Table>
> </NewDataSet>
> ---
>
> And I would use the following XSLT to get an accurate result :
>
> ---
> <?xmlversion="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
> Transform">
> <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/
>
>
>
> <xsl:template match="/">
>   <html>
>   <body>
>   <h2>Lots of Junk</h2>
>     <table border="1">
>       <tr bgcolor="#9acd32">
>         <th align="left">pic</th>
>         <th align="left">name</th>
>      </tr>
>       <xsl:for-each select="NewDataSet/Table">
>       <tr>
>         <td>
>           <xsl:element name="a">
>             <xsl:attribute name="href">
>               <xsl:value-of select="link" />
>             </xsl:attribute>
>             <xsl:element name="img">
>               <xsl:attribute name="src">
>                 <xsl:value-of select="img" />
>               </xsl:attribute>
>             </xsl:element>
>           </xsl:element>
>         </td>
>         <td><xsl:value-of select="name" /></td>
>       </tr>
>       </xsl:for-each>
>     </table>
>   </body>
>   </html>
> </xsl:template>
> </xsl:stylesheet>
> ---
>
> This way, I do not need to bother about escaping HTML tags because
> they are not present in theXML. TheXMLonly stores the data which
> will become the attributes of a tag.
>
> On Nov 20, 10:14 pm, Eoj <[EMAIL PROTECTED]> wrote:
>
> > Hello, new toxmlmarkup, have a question. Need to display a hyperlink
> > in a marked upxmlfile, here is an excerpt. . .
> > ================================================================================
> > <NewDataSet>
>
> >       <Table>
> >         <pic>&lt;a href=http://cas.sdss.org/dr7/en/tools/chart/
> > navi.asp?ra=166.358&amp;dec=-0.748596&gt;
> >                 &lt;img 
> > src="http://casjobs.sdss.org/ImgCutoutDR7/getjpeg.aspx?
> > ra=166.358&amp;dec=-0.748596&amp;scale=0.40&amp;width=120&amp;height=120&amp;opt="/
> > &gt; </pic>
>
> >         <name>J1105<name>
>
> >         <ra>16.25829</ra>
>
> >         <dec>-7.74849605</dec>
>
> >         <mag_g>18.9</mag_g>
>
> >         <id>587722982270959696</id>
>
> >         <sep>0.02</sep>
>
> >  /Table>
>
> > </NewDataSet>
> > =======================================================
>
> > and the xsl is below. The table as displayed in html only has the long
> > link that is not clickable. How does one make a clickable hyperlink
> > from anxmldatabase?
>
> > ==================================================
>
> > <?xmlversion="1.0" encoding="ISO-8859-1"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> > <xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/
>
> > <xsl:template match="/">
> >   <html>
> >   <body>
> >   <h2>Lots of Junk</h2>
> >     <table border="1">
> >       <tr bgcolor="#9acd32">
> >         <th align="left">pic</th>
> >         <th align="left">name</th>
> >      </tr>
> >       <xsl:for-each select="NewDataSet/Table">
> >       <tr>
> >         <td><xsl:value-of select="pic"/></td>
> >         <td><xsl:value-of select="name"/></td>
> >       </tr>
> >       </xsl:for-each>
> >     </table>
> >   </body>
> >   </html>
> > </xsl:template>
> > </xsl:stylesheet>

Reply via email to