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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to avoid parser to read tags in an element?

Status
Not open for further replies.

russland

Programmer
Jan 9, 2003
315
CH
hi, can i somehow write a local DTD (at top of xml file) to ensure that a parse doesn't read html tags in an element

e.g.
<address>super duper road<BR>17404 York PA</address>

that BR tag is not wanted to be processed respectively parsed? any clue?

thanks a lot
 
I got one here, in case anybody else cares:

user <![CDATA[BLAH BLAH BLAH BLHA]]> in that element to prevent the parser from looking into the content
e.g.
<ADDRESS><![CDATA[Henson Road 4353AB<br>2nd Floor]]</ADDRESS>


but, thanks for the tutorial:)
 
Well, that doesn't fit your request for a DTD dodge.

And that's fine as long as you don't want the data parsed. But that begs the question, why use XML at all? Rather than tag your data to make it useful in multiple settings, you've just obscured it in one big blob.

Sure, it takes more work at the outset to create tags like
Code:
<address1>
<address2>
<city>
<state>
<zip>
etc., but at least the next time you need that data again, it's ready for you.

Like I said, I think you've found a way to accomplish what you want for now, but I think you're missing the point of using XML for data representation.
 
thanks, i'll go through a tutorial somewhen the next days. thanks for taking time. merry christmas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top