[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Proposed genx changes


Proposed genx changes
OK, I got C14n wrong (ERH has given me a test suite so it won't happen 
again).  Here's how I'm thinking I'm going to change Genx to do the 
right thing.

Among my c14n mistakes was the belief that you can't have default 
namespaces in C14nized XML.

1. The existing modes work.  You declare namespaces whenever you want, 
Genx will make sure they're in effect if you emit an element or 
attribute that's in a namespace.

2. You can now say
genxDeclareNamespace(w, "http://example.com", "", &status)
to make this the default namespace whenever it's in effect.
IF there is a default namespace in effect and you try to insert an 
element/attribute that's not in a namespace, that's an error.

3. There's a new call genxAddNamespace(genxWriter w, genxNamespace ns) 
that you can mix up with genxAddAttribute calls immediately following a 
genxStartElement call.  The idea is that if you want to control the 
placement of NS declarations, you can.  Normally, you'd do this if you 
knew you were going to have qnames in content and needed to be sure the 
prefixes were declared.

4. There's a new call genxAddAllNamespaces(genxWriter w) which makes 
sure all the namespaces you've declared so far are in scope.  Normally, 
you'd do this on the root element.

5. There's a new call genxAddQName(genxWriter w, genxNamespace ns, utf8 
value) which will emit a QName with the appropriate prefix if you 
(gack, gag) wanted a QName in Element Content.

6. There's a new call
genxAddAttributeWithQName(genxWriter w, genxAttribute a, genxNamespace 
ns, utf8 value)
where the ns prefix and "value" arg are put together to make qname 
attribute value.

Anyone have a better idea?  Simon Fell, would this address your issues? 
-Tim


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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