• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Getting special Character while xml transformation

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a question about passing special character < , > and / while transforming XML using XSL. Can we applies CDATA for each XML tag in XSL?

Thanks for your help in advance,

Abra
 
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what "passing" means in that question. Or "applies". In fact I'm not sure what your question means at all. Do you have an example of what you are asking about?
 
Abrahim Daver
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me explain you this way,
We have an XML (lets call it as "Base XML"), on which we want to apply an XSL to transform it into another XML(Lets call it as "Xformed XML"). The one of the data element of "Base XML" contains special characters (i.e. < OR >). In XSL when I try to fetch the value from this tag, which has special characters in it, it throws an Exception having description as "javax.xml.transform.TransformerException: The conten
of elements must consist of well-formed character data or markup". Is there a way to get those special character as it in "Xformed XML", without encoding them in "<" OR ">". Hope this clears the question. I appreciate your time and feedback on this in advance.
Thanks,
Abra
 
Paul Clapham
Marshal
Posts: 27214
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So your Base XML is not well-formed and the parser rejects it. So no, there is nothing you can do in code to prevent that from happening. You will have to repair the Base XML.
 
Those are the largest trousers in the world! Especially when next to this ad:
ScroogeXHTML - fast RTF to HTML and XHTML conversion
https://coderanch.com/t/749563/ScroogeXHTML-fast-RTF-HTML-XHTML
reply
    Bookmark Topic Watch Topic
  • New Topic