Question

I have a xml blob that's checked against a schema in sql 2005. My website uses xsl to transform and display the blob. How do I add a hyperlink to the xml (in any node) without the sql 2005 schema complaining a node was found in the wrong place? Or the xsl thinking that the hyperlink is a valid xml node?

thank you

Was it helpful?

Solution

I'm guessing you aren't encoding the < and > characters correctly. You need to use &lt; and &gt;

OTHER TIPS

For more advanced html building, you may need to use the xsl:element tag:

  <xsl:element name="a">
    <xsl:attribute name="href">http://www.stackoverflow.com</xsl:attribute>
    Click here
  </xsl:element>

renders

<a href="http://www.stackoverflow.com">Click here</a>

The nice thing about this is that the values for any of the "name" attributes or inner text can be computed xsl values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top