• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

remove strange characters in xml

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I need to remove strange characters in my xml file. Am using transformation method for parsing. While parsing process fails if it encounters strange characters like spaces(It looks like this... )
I will passing 3 parameters to the method (input file, outfile, xslRules)
Am using Transformer class and XALAN.
XML looks lik this and I need the same out put straucture.

<client_note>
<note_id>14233</note_id>
<note_parentid></note_parentid>
<note_author>Viola Grantham</note_author>
<note_author_id>6093</note_author_id>
<note_author_org_id>LST001</note_author_org_id>
<note_date>10/11/2005</note_date>
<note_time>14:30:51</note_time>
<note_subject>receipts</note_subject>
<note_message> Rule 182 clerical duties were performed by paralegal; system unable to differentiate. Rule 178 Wal-Mart requires billing every 30 days. Mileage billed appropriately.</note_message>
<note_public>TRUE</note_public>
<attachment>
<file_id>3004</file_id>
<file_name>222507.PDF</file_name>
<file_size>559991</file_size>
<file_type>RECEIPTS</file_type>
<file_created_date>10/11/2005</file_created_date>
<file_created_time>14:30:51</file_created_time>
<file_author>Viola Grantham</file_author>
<file_deleted_date></file_deleted_date>
<file_deleted_time></file_deleted_time>
<file_deleted_by_name></file_deleted_by_name>
</attachment>
</client_note>

I will post the code if you want......-

Any help will be highly apprecited.



Thanks
Raviraj
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not all characters are valid within an XML file. Maybe the ones in question -whichever they are, it's not clear from your post- are not? If so, they need to be enclosed in CDATA sections.
(As an aside, "parsing fails" is not an adequate description of a problem. The full stack trace would be the minimum information required to start investigating.)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic