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!

Proble with XPath query

Status
Not open for further replies.

abenstex

Programmer
Jan 9, 2005
47
DE
Hi everyone,

i have an xml file that looks like this:
Code:
<myns:importDescription xmlns:myns='[URL unfurl="true"]http://xml.netbeans.org/examples/targetNS'[/URL]
                        xmlns:xsi='[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance'[/URL]
                        xsi:schemaLocation='[URL unfurl="true"]http://xml.netbeans.org/examples/targetNS[/URL] file:/D:/Programmierung/Projekte/JaGeneJDev/JaGene/resources/accessImport.xsd'>
    <myns:mapping accessTableName="someTableName">
        <myns:postgreTable>anthropometrie</myns:postgreTable>
        <myns:csvSeparationChar>;</myns:csvSeparationChar>
        <myns:overwrite>true</myns:overwrite>
    </myns:mapping>
</myns:importDescription>
What i want to do now is to get the values for the postgreTable, overwrite, ... elements depending on the value of the accessTableName attribute. So my query looks like this:
Code:
myns:importDescription/myns:mapping[attribute::accessTableName='someTableName']/myns:csvSeparationChar

where someTableName is the name of the accessTableName attribute. Unfortunately it does not work, because it doesn't retrieve anything.

Thanks
 
On the face of it, it should work under proper conditions. Have you declared the namespace with prefix myns in your xsl? If yes, what is the context where the xpath appears?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top