473,387 Members | 3,821 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,387 software developers and data experts.

parsing string data through castor

I'm trying to parse string data using castor and it looks like the new
lines are getting lost.

I'm using castor 0.9.4.3

For example:

Input

<INPUT> First line
second line
third line </INPUT>

after marshaling and unmarshaling using castor this becomes

<INPUT> First line second line third line </INPUT>

Is there something I can do to preserve the newlines in the data or is
this a bug in castor.

Thanks in advance for the help
Jul 20 '05 #1
1 2044
In article <42**************************@posting.google.com >,
mn****@telcordia.com (madhununna) wrote:
I'm trying to parse string data using castor and it looks like the new
lines are getting lost.

I'm using castor 0.9.4.3

For example:

Input

<INPUT> First line
second line
third line </INPUT>

after marshaling and unmarshaling using castor this becomes

<INPUT> First line second line third line </INPUT>

Is there something I can do to preserve the newlines in the data or is
this a bug in castor.

Thanks in advance for the help

I don't know for sure, but it looks like a bug in Castor
to me. It looks similar to a bug I had to deal with a
few years ago.

Before you get any further with Castor, see how the current
version handles

<INPUT> First line
second <b>line</b> with <i>mixed content</i>
third line </INPUT>

A few years back I worked on a project that had already
chosen Castor before I joined the team. They had found
that the marshaling and unmarshaling mangled the order
of leaf node when some of those leaf nodes were PCDATA,
and they would get something like

<INPUT> First line <b>line</b><i>mixed content</i>second with third
line </INPUT>

(one long line)

back from the system. The people at www.castor.org were
contacted to report the bug, and our team was told that
it wasn't a bug since all of the elements were present in
the output, that castor was intended for data-centric
applications instead of text-oriented applications, that
all parts of the object were present, a Java application
wouldn't "care" one way or the other, and that they were
not going to try to "fix" it.

The fix that the team came up with was to encode the sample
above as

<INPUT><text>First line</text>
<text>second </text><b>line</b><text> with </text><i>mixed content</i>
<text>third line</text></INPUT>

If I remember correctly, it still came back out of the
system as one line, but with all leaf nodes existing
as elements (no mixed content) the ordering survived.

This was all before I joined the team, but as you can
imagine I got an earful about it when I asked why the
hell these <text> elements were being used instead of
traditional mixed content. I could hardly belive it,
but was quickly shown the email correspondence that
documented the whole affair.

Good luck.

- - - -
Jul 20 '05 #2

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

Similar topics

3
by: Casper B | last post by:
The www.castor.org project seems to be gone. I loved this XML-Java binding framework and I am wondering if anyone are aware of what has happened to it?! Thanks, Casper
1
by: Przemyslaw Wegrzyn | last post by:
Hi! I'm quite new to Python. Is there anything like Castor or JAXB available for Python ? All I have found is generateDS.py, but it seems to be very limited and a bit buggy - it seems to be...
2
by: Christophe Geraud | last post by:
I got the following exception with Castor: "The prefix 'xml' is reserved (XML 1.0 Specification) and cannot be declared." I got this exception using or not a mapping file. Can anyone tell what it...
0
by: Ulf Heyder | last post by:
I use castor-0.9.5 with xerces-2.4.0 to automatically generate classes from XSDs via source generator and un-/marshall JAVA objects to/from XML files. My question is how to tell the castor...
2
by: Christophe Vanfleteren | last post by:
Hello, I'm parsing xml that is returned by the Amazon webservices (using their REST interface). Their dev-heavy.xsd has the following entry: <xs:element name="Track"> <xs:complexType>...
4
by: Pushya | last post by:
Hello - I am trying to parse a .XSD file to obtain information about element name and type in the file. I have been trying to find some kind of documentation for Schema Parsing. All I come...
0
by: shaque | last post by:
Hi, I am working on data binding in java. I have dtd,mapping and xml file. the startin of my xml file is as follows: <?xml version="1.0" encoding="UTF-8"?> <!-- Document : text.xml
0
by: manas589 | last post by:
Hi Can any one tell me how to use binding.xml while generating castor bean from an xsd file. i have one xsd file where two element are conflicting. so i thought to use binding file while...
2
by: Roshan Naik | last post by:
Castor is a pure C++ Library that introduces the Logic paradigm (LP) into C++. Although LP has been well explored in Computer science, it remains under utilized in main stream software...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.