2005 Sep 13 3:10 PM
Hi all,
I would like to get xml result like:
<book id="book_0805033106">
<isbn>0805033106</isbn>
<title>Being a Dog Is a Full-Time Job</title>
<character href="character_Snoopy"/>
</book>
<character id="Snoopy">
<name>Snoopy</name>
<since>October 4, 1950</since>
<qualification>extroverted beagle</qualification>
</character>
I found that xml can have references to elements (done with attributes) here: http://www.xml.com/pub/a/2000/10/04/linking/.
How do I create these xml references within xlst (maybe with xsl:key)?
When I create elements, these look like <type></type>, how do I get them looking like <type id="type-id"></type>?
Also I don't know how to create something like <character href="character_Snoopy"/>.
I would apreciate any/all examples.
Thanks in advance,
Fred
2005 Sep 13 4:00 PM
hi, if you want to get <character href="character_Snoopy"/> , you can do like this:
<xsl:attribute name="href">character_Snoopy</xsl:attribute>
<xsl:element name="character" use-attribute-sets="href">
......
</xsl:element>
it's a parts of the XSLT, but I think it's enough for you.
thanks
2005 Sep 13 4:00 PM
hi, if you want to get <character href="character_Snoopy"/> , you can do like this:
<xsl:attribute name="href">character_Snoopy</xsl:attribute>
<xsl:element name="character" use-attribute-sets="href">
......
</xsl:element>
it's a parts of the XSLT, but I think it's enough for you.
thanks
2005 Sep 14 3:06 AM
hi, Fred
Have you tried my answer? Does it work fine?
Maybe the different XSLT version will arise some problem, if so, please make me know.
thanks
2005 Sep 14 7:11 AM
good place to learn XSLT
http://www.topxml.com/xsl/default.asp
http://www.w3schools.com/xsl/default.asp
Regards
Raja
2005 Sep 14 9:08 AM