[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Extracting Schema from an element instance while parsing.
- From: David <dlee@calldei.com>
- To: xml-dev@lists.xml.org
- Date: Tue, 14 Sep 2010 20:19:42 -0400
Great idea about using a parallel ValidatorHandler ... although
to-date I've not gotten standalone validation to work without parsing ...
I'm sure its some magic trick with setting properties ...
Probably just me but I've found over the 10 years of working with the
standard Java API's for XML, nearly impossible to
figure out what the magic settings are to do anything but the most basic
things.
And when I do I pour crazy-glue on it and encase it diamond.
Everything is hidden in optional feature or property "defined by the
implementation" ...
I know its supposed to be an 'open api' so nothing about actual
implementations are documented,
but it so "open" I stare though it and see stars :)
The same properties I set for parsing dont work for validation but I
cant find any references to what to use in their place ...
David A. Lee
dlee@calldei.com
http://www.xmlsh.org
On 9/14/2010 7:50 PM, Michael Glavassevich wrote:
>
> David <dlee@calldei.com> wrote on 09/14/2010 04:00:13 PM:
>
> > Thanks.
> > After posting this post I did run into PSVIProvider and tried it out.
> > Voila ! It worked (probably better then my code !)
> > I felt so dumb ....
> >
> > Except ... it only works while parsing XML not generating it.
> > In my use case I need access to the data while generating an XML
> > document (from a different source),
> > so that I can extract the annotation information *before* generating a
> > particular element (it will guide the decision on what to generate).
> > But using PSVIProvider, I might be able to do the same thing in 2
> passes
> > ... not entirely sure yet, still looking.
> > Thanks for the suggestion.
>
> Not sure how you're making decisions on what to write, but if you need
> to know the element declaration before you write the element, you
> could always keep a ValidatorHandler on the side and push SAX events
> to it and then retrieve the PSVI.
>
> > There still is a use case (which I dont need yet but I think is useful).
> > That is, given a simplified XPath, find the XSD information - Without
> > having an instance document.
> >
> >
> >
> > David A. Lee
> > dlee@calldei.com
> > http://www.xmlsh.org
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]