users@jaxb.java.net

Re: Tag name not allowed... but the same tag-name is in allowed set?

From: Steven Cummings <stevenc79_at_yahoo.com>
Date: Mon, 16 Jun 2003 12:31:02 -0700

--- Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM> wrote:
> I'm sorry for this confusing error message, but I think
> you got the namespace
> URI wrong in your document.
>
>
> > This leads me to something I've been thinking about
> lately.
> > It would be nice if there were some "update" hooks in
> JAXB
> > that were more friendly to updating parts of documents
> and
> > node-structures. In my example above, I want to
> unmarshall
> > one part of a document and then update it back. Of
> course I
> > can do this, but it requires nothing short of loading
> the
> > whole DOM into memory, and seeking to that node myself
> for
> > manipulation.
>
> Take a look at the partial-unmarshal example. Also,

Sorry about that. I forgot there were examples besides
those for the users-guide.

> combining JAXB with
> upcoming StAX (JSR-173) would probably lets you do this
> fairly easily.
>
> If you want to try that today, go to
> http://www.xmlpull.org
>
> The idea is that you read through a pull-parser (or SAX
> events) and send
> them to the writer, and when you hit the real meat, you
> bind that region
> to JAXB, do the processing, write them back, then you
> copy the rest of
> the input to the output.
>
> Given the number of questions on this topic, perhaps this
> might deserve
> its own sample.
>
>
> > What if JAXB allowed unmarshalling and marshalling
> methods
> > to specify XPath expressions to try to either find an
> > unmarshallable object at, or to write an marshallable
> > object to (replacing an existing instance, or updating
> it).
> > Is this very possible with the current RI? Is anybody
> else
> > thinking about it? Thanks!
>
> Using XPath would rob the whole point since it requires a
> whole document
> to be present on memory.
>

True. But XPath minus the backtracking (ancestor, parent,
etc.) and sideways-tracking (sibling, preceeding, etc.)
axes could be implemented without DOM.

>
> --
> Kohsuke Kawaguchi <kohsuke.kawaguchi_at_sun.com>


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com