logo       

Re: [stax_builders] Once more about XMLStreamReader, setPrefix(): msg#00000

Subject: Re: [stax_builders] Once more about XMLStreamReader, setPrefix()
Tatu Saloranta wrote:

>After spending 3 days trying to figure out how to do
>simple
>outputting of namespaces using StAX API, I'm almost
>ready to give up. :-)
>Although the example in 1.0 specs seems
>straight-forward enough:
>  
>
we do *need* to fix this!!!!

now the tricky part id if we can fix it by clarifying spec and RI or it 
is hopeless?

>(a) call setPrefix() for all namespaces you need for
> the _next_ starting element
>(b) call writeStartElement()/writeEmptyElement()
>(c) output all namespaces with writeNamespace()
>  (and/or writeDefaultNamespace()
>
>the problem is that RI, for example, does something
>quite different (it lacks step (c) for one; and
>that may be due to step (b) doing actual output...
>or something).
>
>Now, this is specifically WRT non-repairing mode:
>repairing mode has its own issues.
>
>What I'd like two know is answers to following
>questions:
>
>(a) Is calling setPrefix() AND writeNamespace() (plus
>  alternatives for the default NS) always obligatory
>  in non-repairing mode? Or is setPrefix(), for
>example
>  only needed if automatic mapping of URI to prefix
>  is needed, but not when 3 arg version is used?
>(b) Independent of how namespace mappings are created,
>  what is the scope? Is it the CURRENT element (one
>  that's open, ie. last for which writeStartElement
>  was called), or the NEXT one (that will next get
>  written out)? Sample seems to suggest NEXT (and
>  I implemented it that way for Woodstox); this makes
>  sense since otherwise there'll be extra work when
>  trying to put the root element in a namespace.
>  
>
this is place where we need to put clarifications, agree about and 
implement in RI and all other StAX parser IMHO.

>I looked at xmlpull, and it is bit clearer in this
>respect. There are no prefix-AND-URI variations
>for writing elements and attributes; and namespace
>bindings always have to be declared before the
>start element. But StAX RI does not work this
>way -- perhaps this is a bug?
>
>In fact, I'm not quite sure what was the added value
>of trying to allow more than one way of doing things
>(in StAX API):
>it also looks like xmlpull basically allows both
>repairing and non-repairing operation, without
>separate modes (either call setPrefix(), to define 
>binding, or omit it and binding will be automatically
>created).
>  
>
as you mentioned XmlPull: sometimes is handy to have prefix explictly 
selected for element if more than one prefix is avaliable fo rthe same 
namespace (and this is actually criticial for XML security ...)

alek

-- 
The best way to predict the future is to invent it - Alan Kay



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/2U_rlB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xmlpull-dev/

<*> To unsubscribe from this group, send an email to:
    xmlpull-dev-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe