473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

unintentionally modified whitespace in attribute values

Hello *,

doing some experiments with dom4j, I experience modifications of - and -entities
in attribute values:
running a filter, which first deserialises the xml-stream, performs some dom transformations
and then serialises the dom, in a first run, the entities mentioned get converted to
line-feeds {a fact, I could live with, since it's near loss-less}, which in a second run
through the filter will be converted to blanks. And this is, what I don't want to live with.
BTW: other SGML-entities in attributes are not touched.

Reading quite a bunch of docs and fiddling with the obvious parameters, I don't find a way
to let those entities be left unmodified. May be, this behaviour is not only a peculiarity
of dom4j, but of other XML-processors too.

Any ideas???

Markus

PS: setup of reader and writer:
-------8<------
// give reader...
; setReader(new SAXReader())
; getReader().setStripWhitespaceText(true)
; getReader().setMergeAdjacentText(true)
; getReader().setStringInternEnabled(true)

// ... and writer some reasonable defaults:
; setEncoding(new String("UTF-8"))
; setOutput_format(new OutputFormat("\t", true, getEncoding()))
; getOutput_format().setExpandEmptyElements(false)
; setWriter(new XMLWriter(getOutput_format()))
-------8<------
Jul 20 '05 #1
0 1081

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Celedor | last post by:
If I understand correctly, canonicalized XML is a simplified, or rather, "standardized" form of XML. It is in such a form such that two documents that are written in different ways, but contain...
8
by: Tjerk Wolterink | last post by:
Hello all, how does xsl handle white space? I know you can set domething like this for nice indentation: <xsl:output method="xhtml" indent="yes"/> But know i have xsl code like this:
2
by: josh.asbury | last post by:
I am having some major issues with whitespace in my XSL stylesheets. We recently upgraded our servlet-based application to JDK 1.4, and this has forced the issue of my finally upgrading to...
0
by: Markus | last post by:
Hello *, doing some experiments with dom4j, I experience modifications of - and -entities in attribute values: running a filter, which first deserialises the xml-stream, performs some dom...
5
by: Kevin Westhead | last post by:
I'm using XslTransform to apply a transform to an XML document, however I get validation problems when parsing the resulting XML document due to invalid whitespace. I'm passing in an XPathNavigator...
0
by: Daniel Cazzulino [MVP XML] | last post by:
Hi guys, I need an attribute (could be an element too) to have its whitespace collapsed . I don't get the expected behavior, however. The schema is as follows: <xs:schema ...> <xs:element...
5
by: Geoff Bennett | last post by:
While parsing an XML document, my TextReader instance skips nodes. For example, in this fragment: <Person Sex="Male" FirstHomeBuyer="No" YearsInCurrentProfession="14"> <RelatedEntityRef...
9
by: amattie | last post by:
Does anyone have any idea on how I can strip the extra whitespace in the XML that shows up when I receive a response from an ASP.NET 2.0 webservice? This has been discussed before, but no one has...
1
by: andrew_nuss | last post by:
Hi, Lets say I have a MIXED tag in my XML DTD with content that is going to be rendered as HMTL, as well as a <boldand <italicstag. What about whitespace? Specifically, does the whitespace in...
5
by: John Gordon | last post by:
My XSLT files have many occurrences of this general pattern: <a> <xsl:attribute name="href"> <xsl:value-of select="xyz" /> </xsl:attribute> </a> When I execute an XSL transform, the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.