This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
how to refer to xml elements when using the document() function
- To: XSL-List at mulberrytech dot com
- Subject: how to refer to xml elements when using the document() function
- From: Teresa dot Mairal-Barreu at dfat dot gov dot au
- Date: Tue, 28 Nov 2000 16:21:05 +1100
- Reply-To: xsl-list at mulberrytech dot com
I have been searching for the use of the document() function but I have
found very little information and in some cases some of the examples didn't
work when I tried them.
I have to work with two different xml sources and I've been using document
() but my question is what syntax to use to refer to individual elements
belonging to 2 different input sources. I'm using xt and so far the only
result I get is no result or the whole xml document is pasted into the
output.
I have tried:
<xsl:variable name="cmissions"><xsl:value-of select="document
('../missions/missions.xml', /)"/></xsl:variable>
and then refer to elements in the following way:
<xsl:value-of select="$cmissions/mission/country_code"/>. This gives me an
"unable to resolve node-set error".
I also need to get the contents of <misscity> for each <hom_country> ie
hom_country_code and hom_country have to be compared and the corresponding
city has to be part of the output. How do I refer to each hom_country and
country_code?
I'd appreciate it if you could help.
homs.xml
--------------
<homs_list>
<hom>
<hom_type>abc</hom_type>
<hom_name>xyz</hom_name>
<hom_country_code>fr</hom_country_code>
</hom>
<hom>
.....
</hom>
<homs_list>
missions.xml
-------------------
<missionspage>
<mission>
<country_code>fr</country_code>
<missaddress>
<misstreet>xyz</misstreet>
<misscity>abc</misscity>
</missaddress>
</mission>
<mission>
...
</mission>
</missionspage>
Teresa
_________________________________________
Teresa Mairal Barreu
Public Diplomacy Division
Images of Australia Branch
International Media Strategies Section
Australian Department of Foreign Affairs and Trade
teresa.mairal-barreu@dfat.gov.au
http://www.dfat.gov.au
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list