|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] how to refer to xml elements when using the document() funct
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@xxxxxxxxxxx
http://www.dfat.gov.au
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








