SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : XML Technologies :

Previous DiscussionNext Discussion
 XPath for IDREF

i have a xml node which has a "sID" attribute has data type of IDREF. and for ex. i want to find nodes which contains "tr01" in sID attribute.

i'm using visual studio and c# but i couldnt write a xpath query that gives this result. (i found out "contains" method that can do this but could not use it in a xpath expression.)
ex. :

<book name="try1" sID="tr01 tr02 tr03">
<book name="try2" sID="tr02 tr03">
<book name="try3" sID="tr01 tr03">
i want to find try1 & try3

Started By mavilym on May 11, 2006 at 1:24:37 PM
This message has been edited.

1 Response(s) | Reply

Earlier Replies | Replies 1 to 1 of 1 | Later Replies
MHenke on May 12, 2006 at 1:18:22 AM (# 1)

Well, that's not well-formed XML, not even as document fragment.

> i found out "contains" method that can do this but could not use it in a xpath expression.
You can.
Assumed you handle documents like

<?xml version="1.0" encoding="UTF-8"?>
<books>
  <
book name="try1" sID="tr01 tr02 tr03"
/>
  <
book name="try2" sID="tr02 tr03"
/>
  <
book name="try3" sID="tr01 tr03"
/>
</
books>

You could try an XPath like

//books/book[contains(@sID, 'tr01') and contains(@sID, 'tr03')]

 


Earlier Replies | Replies 1 to 1 of 1 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.