[jdom-interest] (no subject)

Jason Hunter jhunter at acm.org
Wed Dec 5 18:30:34 PST 2001


Using the latest code in CVS I see this output:

<?xml version="1.0" encoding="UTF-8"?>
<univ:tag xmlns:univ="http://someurl#">
     <innertag univ:id="someid" /></univ:tag>

That's semantically correct, so Thomas I think your problem is gone at
least in the latest code.

One problem though:  the line feed got eaten.  Backtracking shows me
XMLOutputter change 1.63 is to blame (1.62 works).

revision 1.63
date: 2001/07/20 03:31:34;  author: bmclaugh;  state: Exp;  lines: +39
-42
Committing a change to XMLOutputter submitted by Lars Hoss. This fixes a
bug in XMLOutputter, generally occurring when documents are constructed
from an instance of DOMBuilder. It was generating additional newlines,
and there were additional checks in the content iteration loop that
needed to be checked to prevent these extraneous new lines from being
written out. This results in correct behavior for setTextNormalize() and
setNewlines().

Seems this fixed a bug where new lines were added, but added a bug where
newlines could be removed.  Looking at the change, it took an overly
simplistic view of the problem.  Need to mark the newline thing as a bug
to fix.

-jh-

Thomas Enzi wrote:
> 
> Hello,
> 
> I`ve a problem with SAXParser and it would be really nice, if someone could help me.
> I am parsing an XML-Instance using the JDOM SAXBuilder.
> 
> Instance:
> 
> <univ:tag xmlns:univ="http://someurl#" >
>      <innertag univ:id="someid"/>
> </univ:tag>
> 
> When printing it (with XMLOutputter) I get the following result:
> 
>  ?xml version="1.0" encoding="UTF-8"?>
> <univ:tag xmlns:univ="http:/someurl#">
>         <innertag id="someid" />
> </univ:tag>
> 
> so the attribute "id" from "innertag" does not have a ns-prefix, but I need it.
> The same happens when walking through this instance and accessing the
> Attribute (using class Attribute). There also attribute.getNamespace or getNSPrefix
> does not provide the prefix.
> 
> I found out that this happens to all attributes that have the namespace-prefix that is used
> in the first parent of an instance.
> 
> What can I do to avoid it?
> 
> best Regards
> 
> Thomas
> 
> <><><><><><><><><><><><><><><><><><><><><><><><><><><>
> Thomas Enzi                             Thomas.Enzi at wu-wien.ac.at
> Research and Development, UNIVERSAL (http://www.ist-universal.org/)
> <><><><><><><><><><><><><><><><><><><><><><><><><><><>
> Department of Information Systems, New Media
> Vienna University of Economics and Business Administration
> <><><><><><><><><><><><><><><><><><><><><><><><><><><>
> Abteilung für Wirtschaftsinformatik, Neue Medien
> Wirtschaftsuniversität Wien
> Augasse 2-6, A-1090 Vienna, Austria http://nm.wu-wien.ac.at
> Tel: (+43-1) 31 336 x4417, Fax: (+43-1) 31 336 x746
> <><><><><><><><><><><><><><><><><><><><><><><><><><><>
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list