Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Question Flash/XML 1

Status
Not open for further replies.

acarr0305

Programmer
May 16, 2006
2
US
I can loop through the nodes and pull content out of the xml that is in brackets i.e. <name>John</name>.

How do I pull something like this: <name Pagenum="2">John</name> and basically pull only the name where pagenum=2.

Here is part of the actual xml file:
---------------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
- <course>
+ <globalInfo>
<courseName>"Q-20"</courseName>
<uiPath>"Interface/[fileName]"</uiPath>
<graphicsPath>"media/"</graphicsPath>
<templatesPath>"templates/[templateName]"</templatesPath>
<dataPath>"data/"</dataPath>
</globalInfo>
- <topics>
- <topic orderID="1">
- <pages>
+ <pageData pageNum="1">
<fileName>"AN_AQS_20AMDS-AAA-A20-00-00-0000-001A-T.xml"</fileName>
<templateName />
- <navText>
"Click
<I>Next</I>
to continue"
</navText>
</pageData>
- <pageData pageNum="2">
<fileName>DMC-AN_AQS_20AMDS-AAA-A20-00-00-0002-041A-T.xml</fileName>
<templateName>splitpane.swf</templateName>
- <navText>
"Click
<I>Next</I>
to continue"
</navText>
</pageData>
- <pageData pageNum="3">
<fileName>DMC-AN_AQS_20AMDS-AAA-A20-00-00-0003-018A-T.xml</fileName>
<templateName />
- <navText>
"Click
<I>Next</I>
to continue"
</navText>
</pageData>
---------------------------
Thanks in advance!
 
>How do I pull something like this: <name Pagenum="2">John</name> and basically pull only the name where pagenum=2.

You can just add a conditional to control the value-of element in the context of the "name" node.
[tt]
<xsl:if test="@Pagename = '2'">
<xsl:value-of select="." />
</xsl:if>
[/tt]
 
Thank you I am going to look into this today. I'll let you know if it works.

=)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top