[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Fwd: querying attribute?

Ronald Bourret rpbourret at rpbourret.com
Wed Mar 18 20:34:10 PST 2009


 Fwd:  querying attribute?
Thomas R. Jones wrote:
>> So it is correct to declare and reference namespace prefixes within 
>> xquery even though they are not "explicitly" done so in source code?

I'm not sure what you mean by "source code". Do you mean the XML document?

What XQuery requires is that, after prefixes and the default namespace 
are resolved, the names in the query must be the same (namespace and 
element/attribute name) as the names in the XML document in order to 
have a successful match.

>> I'm guessing the parser is handling this natively. The XML source is 
>> located within an international database and it strips prefix 
>> declarations within the import triggers. :(

Stripping prefix declarations is almost certainly an error -- I'd be 
curious to hear the reason for it. There are two problems:

1) If the trigger leaves the prefixes in the element and attribute 
names, the resulting document is namespace invalid, as the prefixes are 
not declared.

2) If the prefixes are also stripped from the element and attribute 
names, the resulting document, although namespace valid, is not the same 
document. Namespaces are used to create two-part names for elements and 
attributes, and removing half the name (the namespace) is akin to 
changing the element and attribute names themselves.

-- Ron


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-2007 All Rights Reserved.