[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How can I find a particluar element in an XML file?

Subject: How can I find a particluar element in an XML file?
From: "Phil" <Phillip@xxxxxxxxxxx>
Date: Wed, 22 Aug 2001 17:05:14 +0100
find element in xml file

 I am trying extract a particular data item and so far have been unable to
find out how to do it, any help would be much appreciated.

Below is an extract of my  input XML file :

<?xml version="1.0"?>
<table name="Industry">
	<row command="update">
		<column name="Periodical">No</column>
		<column name="personID">ML101363</column>
		<column name="PersonNumber">449.0773</column>
	</row>
</table>

I want to be able to grab the value of 'personID' (In this case ML101363),
my problem is that do not know how to specifically request personID, is
there a 'where' clause or something similar I can use?

This is how I would like my XML output file to appear.

< PRODUCT >
	<PersonID>ML101363</PersonID>
</ PRODUCT >



The XSL below simply selects al the columns but how can I request a specific
column name. Any help much appreciated.

<?xml version='1.0' encoding='utf-8' ?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml"/>

<xsl:template match="/">
	<PRODUCT>
          		<xsl:apply-templates select="/table/row/column" />
	</PRODUCT>
</xsl:template>


<xsl:template match="column">
	<PersonID>
     <xsl:value-of select="."/>
	</ PersonID >
</xsl:template>

</xsl:stylesheet>





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.