SV: SV: [jdom-interest] How do you do it in JDOM?
Per Norrman
pernorrman at telia.com
Tue Feb 17 06:46:17 PST 2004
I never said anything about startPrefixMapping ... the xml prefix is
by definition bound to http://www.w3.org/XML/1998/namespace, so it does
not need to be mapped.
JDOM expects that the URI is reported in the call to
org.xml.sax.Attributes#getURI(index). I guess that this is where your
exception
occurrs. If you're using org.xml.sax.helpers.AttributesImpl it's a
simple
matter to include the namespace uri.
/pmn
> -----Ursprungligt meddelande-----
> Från: Chris B. [mailto:chris at tech.com.au]
> Skickat: den 17 februari 2004 15:17
> Till: Per Norrman
> Kopia: jdom-interest at jdom.org
> Ämne: Re: SV: [jdom-interest] How do you do it in JDOM?
>
>
>
> Yes, but the javadoc for ContentHandler says.....
>
> There should never be start/endPrefixMapping events for the
> "xml" prefix, since it is predeclared and immutable.
>
> That makes me wonder if it is a JDOM bug, since xml is assumed
> "predeclared".
>
> Besides which, making a call to ContentHandler.startPrefixMapping for
> "xml" seems to be ineffective.
>
>
> Per Norrman wrote:
>
> >Hi,
> >
> >make sure that this attribute reports the correct namespace uri:
> >http://www.w3.org/XML/1998/namespace
> >
> >/pmn
> >
> >
> >
> >
> >>-----Ursprungligt meddelande-----
> >>Från: jdom-interest-admin at jdom.org
> >>[mailto:jdom-interest-admin at jdom.org] För Chris B.
> >>Skickat: den 17 februari 2004 13:58
> >>Till: jdom-interest at jdom.org
> >>Ämne: Re: [jdom-interest] How do you do it in JDOM?
> >>
> >>
> >>Ok, so I override createParser() in SAXBuilder so that I can
> >>use my own
> >>custom XMLReader.
> >>
> >>The trouble is, my XML reader creates XML elements that contain the
> >>attribute xml:space="preserve".
> >>
> >>And I get the error....
> >>
> >>ER org.jdom.IllegalNameException: The name "xml" is not legal for
> >>JDOM/XML Namespace prefixs: Namespace prefixes cannot begin
> >>with "xml"
> >>in any combination of case.
> >>ER at org.jdom.Namespace.getNamespace(Namespace.java:154)
> >>ER at
> org.jdom.input.SAXHandler.startElement(SAXHandler.java:511)
> >>
> >>Should this be regarded as a bug in JDOM?
> >>
> >>
> >>_______________________________________________
> >>To control your jdom-interest membership:
> >>http://lists.denveronline.net/mailman/options/jdom-interest/yo
> >>
> >>
> >uraddr at yourhost.com
> >
> >_______________________________________________
> >To control your jdom-interest membership:
> >http://lists.denveronline.net/mailman/options/jdom-interest/y
ouraddr at yo
>urhost.com
>
>
More information about the jdom-interest
mailing list