Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input encoding and DTDs

Status
Not open for further replies.

MrTom

Programmer
Mar 13, 2001
383
GB
ok, i have an xml file which i download from somewhere, an dtd from the same place and an xslt file i created myself to transform the xml to html.

the xslt works fine, but only by changing the xml i was given. this is because the xml file contains many "&" "?" between tags so i've had to change them to &#123 or wotever. but seeing as i will have to download fresh xml each time i'd like to avoid using a big regex to do this.

so i need to know where this DTD i've got comes in to play. the DTD specifies that the bits with &quot;?&quot; and &quot;&&quot; are &quot;PCDATA&quot; which is fine by me, but i'm not sure how to tell my processor to use it. the xml file has no xml headers i've commonly seen, it just starts with <data>.

can i use a standard header to say &quot;use this dtd&quot; and if i later want to make a new xml schema (it appeals more to my programmers mind ;-) can i use the same heading?

OR is there a way of telling the parser not to examine data in between tags, ie. assume it's ALL PCDATA?

i'd appreciate any help or discussion. xml (like java) has so many buzz words it makes it difficult to learn from scratch. :)
 
I admit to being pretty &quot;newbie&quot; at this, but isn't your DTD supposed to use an element-content type of CDATA rather than PCDATA if those kinds of symbols are supposed to be passed without using entities (&amp; for example)?

I thought that PCDATA meant &quot;parsed character data&quot; or something, while CDATA was straight &quot;character data&quot; but I may be confused as well.

Good luck!
 
Sorry, I was trying to say &quot;(ampersand symbol)amp;&quot; but it got rendered as just an ampersand here!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top