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
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Neal WaltersSubject: New XPath Query Window in Release 3
Author: Neal Walters
Date: 14 Jun 2006 03:53 PM
I love some of the new featuers in your new Xpath Query window,
but I also have some comments and questions.

1. Would be nice to right-click tab and choose close, rather than
having to use the red-X at the top.

2. I'm famous for these long Xpath expressions that require use of local-name() functio because I have schema with non-prefixed namespaces.

Here's an exmaple of a "simple" query generate by right-click "Copy Xpath Query to Clipboard".

/*[local-name()='ConstituentProcessRequest' and namespace-uri()='http://schemas.compassion.com/constituent/processrequest/2005-10-01']/*[local-name()='RequestDateTime' and namespace-uri()='http://schemas.compassion.com/constituent/processrequest/2005-10-01'][1]

It's still kind of hard to edit this in the window.
It would be nice if you had a wrap function or an auto-split that would break this onto multiple lines.


3. Using your redefined prefixes, I got this to work:
/ns1:ConstituentProcessRequest/ns1:RequestDateTime

So I'm guessing you create these prefixes just for the life of the xquery? Is there a way to do something like that in .NET with xmlDoc.SelectNodes(xpath)?

I'm wondering what use this could be? I guess if was needing an XPath for XSLT, I could test it and then create a namespace in XSLT that matches the "redefined" namespace?


4. I was also hoping for something like an XPath Query Builder - maybe modeled after Microsoft's SQL Query Builder.

I also tried a simple "Books" schema with no namespaces.
I was unable to see the "Stylus Studio's Sense:X" in the Xpath Query window as I was typing. I actually read the help system and saw the example there.

5. Why isn't the right-click "Copy Xpath Query to Clipboard" feature available from the "Text" tab of an xml file (Why does the user have to be switch tree or grid mode).

6. What about Xpath V1 vs V2? Where did the option to choose go?




Sample XML for above Xqueries:

<ConstituentProcessRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SchemaVersion="1" xmlns="http://schemas.compassion.com/constituent/processrequest/2005-10-01">
<RequestDateTime>2006-06-14T09:31:06.1875000-06:00</RequestDateTime>
</ConstituentProcessRequest>

Thanks
Neal Walters
http://Biztalk-Training.com - Learn Biztalk Faster
http://Sharepoint-Training.com - End User Training
http://VBScript-Training.com - Learn by demos/videos


Postnext
Ivan PedruzziSubject: New XPath Query Window in Release 3
Author: Ivan Pedruzzi
Date: 15 Jun 2006 11:40 PM
3) The remarks on XmlNode.SelectNodes(String) reads as follow

<<"If the XPath expression requires name-space resolution, you must use the SelectNodes overload which takes an XmlNamespaceManager as its argument. The XmlNamespaceManager is used to resolve names-paces">>

http://msdn2.microsoft.com/en-us/library/hcebdtae(VS.80).aspx

The re-defined namespace prefix is required when the document binds the same prefix to different names-paces.

for example given the following document

<a:A xmlns:a='aaa'>
<a:A xmlns:a='bbb'/>
</a:A>

Consider the expression //a:A, the prefix a is anbiguous.

XPath Query Editor in this case creates

NS prefix re-defined prefix
aaa a a
bbb a a1



5) It's metter of performance trade-off we prefer to avoid.

6) XPath Query Editor is V2 only.


Hope this helps
Ivan Pedruzzi
Stylus Studio Team

Postnext
Neal WaltersSubject: New XPath Query Window in Release 3
Author: Neal Walters
Date: 16 Jun 2006 12:05 PM
Thanks for the info.

What about this one 4) in my original post.

I was unable to see the "Stylus Studio's Sense:X" in the Xpath Query window as I was typing. I actually read the help system and saw the example there.

I was using a simple xml documents (book/title/author), no namespaces.



Postnext
Minollo I.Subject: New XPath Query Window in Release 3
Author: Minollo I.
Date: 16 Jun 2006 12:26 PM
The document needs to be associated to an XML Schema or DTD to get Sense:X working on element/attributes.

Postnext
Neal WaltersSubject: New XPath Query Window in Release 3
Author: Neal Walters
Date: 16 Jun 2006 01:10 PM
Ah, that makes sense. But it's a bummer because we have issues accessing our Biztalk schemas in the professional edition (apparently have to update to Enterprise). See this post:
http://www.stylusstudio.com/SSDN/default.asp?action=9&fid=23&read=4652


Also, here is my sample data for playing with the "Sense:X"

<?xml version="1.0"?>
<books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:///C:/BooksDemoSchema.xml">
<book>
<author>John</author>
<title>Blah blah</title>
</book>
</books>

If I do this query
/books/book/
I see "author" in the list.

But if I do this query:
//book/
then "author" does not show up in the list.

Thanks
Neal


Posttop
Minollo I.Subject: New XPath Query Window in Release 3
Author: Minollo I.
Date: 16 Jun 2006 01:24 PM
Yes, the inability to use senseX both when no schema is associated to the document, and when the "//" operator is used, are part of future enhancements.

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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.