d86
Programmer
- Aug 4, 2008
- 2
Hello,
this the xml code
i'm having trouble understanding how select works.
in xPath tutorial I learned that . selects current node
this is the xsl code
I thought that no output would be available since there are no text children in photo. but when i run the code the text of all children in photo is shown?
Problem #2: what is the structure of <name>?
I know that <name>picture #1</name> is really <name><unnamedtextnode>picture #1</unnamedtextnode></name>
but when i append <extratext>abc</extratext> how does that affect the text node inside?
Problem #3: assuming <extratext> stays where it is. how does one select picture #1?
if you could help
thank you
this the xml code
Code:
<photo>
<name>picture #1
<extratext>!!!!111</extratext>
</name>
</photo>
i'm having trouble understanding how select works.
in xPath tutorial I learned that . selects current node
this is the xsl code
Code:
<xsl:template match="/">
<html><body>
<xsl:apply-templates />
</body></html>
</xsl:template>
<xsl:template match="photo">
Name: <xsl:value-of select="." />
</xsl:template>
I thought that no output would be available since there are no text children in photo. but when i run the code the text of all children in photo is shown?
Problem #2: what is the structure of <name>?
I know that <name>picture #1</name> is really <name><unnamedtextnode>picture #1</unnamedtextnode></name>
but when i append <extratext>abc</extratext> how does that affect the text node inside?
Problem #3: assuming <extratext> stays where it is. how does one select picture #1?
if you could help
thank you