Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[CDATA question

 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a xml segment like

***
...
<filename><![CDATA[d:\mydir\myfile]]>
</filename>
...
...
*****

what I meant is to specify "d:\mydir\myfile" as the "filename" in the XML file. Is this the right way to do it ? please point out any syntax error.

Thanks.
 
Paul Clapham
Sheriff
Pie
Posts: 20771
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're asking whether that's the correct syntax for a CDATA section, then it looks to me like it is, but you would get a more reliable (and probably faster) by running it through an XML parser.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic