[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xerces-j-user
Subject:    Re: Name-value pairs in xml root tag
From:       Michael Glavassevich <mrglavas () ca ! ibm ! com>
Date:       2009-07-03 15:54:18
Message-ID: OF98E96143.BA65FF0C-ON852575E8.0056BD3A-852575E8.00575E96 () ca ! ibm ! com
[Download RAW message or body]

govelogo <govelogo@gmail.com> wrote on 07/03/2009 12:39:55 AM:

> Hi Michael,
>
> I thought this would solve my problem. But I run into an order issue.=

>
> What I want is to be able to match from a uri to its prefix while
> parsing through an xml. It seems=A0startPrefixMapping() is paired
> with=A0startElement(). So if there is a xsi:type attribute of the
> element pointing to a new type yet been parsed, I won't be able to
> find the prefix in the uri -> prefix hashtable I have been keep track=
ing.

Um... why not? The startPrefixMapping() calls come first. You should al=
ways
have all the information you need to do prefix -> uri mapping on any
startElement()..

> It seems to me that a SAX parser may not work for what I want. Is
> there a sample using a DOM parser to traverse a DOM tree and still
> be able to use JAXP to get TypeInfo and ElementPSVI?

There are plenty of samples, FAQs and articles which show how to use or=

talk about how to use these things in isolation, but you'd probably hav=
e to
connect the dots yourself.

> thanks a lot,
> David

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org=

[Attachment #3 (text/html)]

<html><body>
<p><tt>govelogo &lt;govelogo@gmail.com&gt; wrote on 07/03/2009 12:39:55=
 AM:<br>
<br>
&gt; Hi Michael,</tt><br>
<tt>&gt; <br>
&gt; I thought this would solve my problem. But I run into an order iss=
ue.=A0</tt><br>
<tt>&gt; <br>
&gt; What I want is to be able to match from a uri to its prefix while =
<br>
&gt; parsing through an xml. It seems=A0startPrefixMapping() is paired =
<br>
&gt; with=A0startElement(). So if there is a xsi:type attribute of the =
<br>
&gt; element pointing to a new type yet been parsed, I won't be able to=
 <br>
&gt; find the prefix in the uri -&gt; prefix hashtable I have been keep=
 tracking.</tt><br>
<br>
<tt>Um... why not? The startPrefixMapping() calls come first. You shoul=
d always have all the information you need to do prefix -&gt; uri mappi=
ng on any startElement().</tt><br>
<tt><br>
&gt; It seems to me that a SAX parser may not work for what I want. Is =
<br>
&gt; there a sample using a DOM parser to traverse a DOM tree and still=
 <br>
&gt; be able to use JAXP to get TypeInfo and ElementPSVI?</tt><br>
<br>
<tt>There are plenty of samples, FAQs and articles which show how to us=
e or talk about how to use these things in isolation, but you'd probabl=
y have to connect the dots yourself.</tt><br>
<tt><br>
&gt; thanks a lot,</tt><br>
<tt>&gt; David</tt><br>
<br>
<tt>Thanks.</tt><br>
<br>
<tt>Michael Glavassevich<br>
XML Parser Development<br>
IBM Toronto Lab<br>
E-mail: mrglavas@ca.ibm.com</tt><br>
<tt>E-mail: mrglavas@apache.org</tt></body></html>=


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic