XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Bob ChauvinSubject: How to navigate to a ref node
Author: Bob Chauvin
Date: 29 Jan 2006 11:45 PM
Given the snippit below, what would the search string for the beginning of the my:Matters so I could get all of it's elements (ie, that the ref: Matter includes a code, notes, mattertype and industrycode)?

Notes: I'm trying to read my xsd and build xml to match those requirements, based on data from a sql data source.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/office/infopath/2003/my/2006-01-05T14:10:19" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/my/2006-01-05T14:10:19" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xs:element name="myFields">
<xs:complexType>
<xs:sequence>
<xs:element ref="my:Matters" maxOccurs="unbounded" minOccurs="0"/>
<xs:element ref="my:Addresses" maxOccurs="unbounded" minOccurs="0"/>
<xs:element ref="my:MailPreferences" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="my:ReferralSource"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<xs:element name="Matters">
<xs:complexType>
<xs:sequence>
<xs:element ref="my:Code"/>
<xs:element ref="my:Notes"/>
<xs:element ref="my:Mattertype"/>
<xs:element ref="my:IndustryCode"/>
</xs:sequence>
</xs:complexType>
</xs:element>


</xs:schema>

Postnext
Tony LavinioSubject: How to navigate to a ref node
Author: Tony Lavinio
Date: 30 Jan 2006 09:02 AM
Well, the XPath to the Matters elements would probably be the following,
but it's not clear what you're asking, since you asking in the context of
an XQuery forum.

/*[local-name()='myFields' and namespace-uri()='http://schemas.microsoft.com/office/infopath/2003/my/2006-01-05T14:10:19']/*[local-name()='Matters' and namespace-uri()=../namespace-uri()]

Postnext
Bob ChauvinSubject: How to navigate to a ref node
Author: Bob Chauvin
Date: 30 Jan 2006 12:45 PM
Hi, Thanks, Yeah, I didn't know what forum to put the question to. That answered my question.

P.S. Will the Copy XPath to Clipboard functionality be able to generate XPath based on named elements instead of positional [1] type of notation.

Postnext
Tony LavinioSubject: How to navigate to a ref node
Author: Tony Lavinio
Date: 30 Jan 2006 02:12 PM
It does use named elements; the [1] just gets you to whichever one you
were on. If you remove the [1] (or whatever number), it will select the
set that match that node.

Also, if you are looking for a particular value, like the ZZZ in this:

<abc><def>AAA</def><def>ZZZ</def></abc>

You would take off the [1] and put instead [. = 'ZZZ']

Does that help at all?

Posttop
Bob ChauvinSubject: How to navigate to a ref node
Author: Bob Chauvin
Date: 30 Jan 2006 02:55 PM
Yes, Tony. Thanks for your continued help... YOU the man!

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.