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

CDATA problem - XML Newbie!!

Status
Not open for further replies.

beaniebear

Programmer
Sep 14, 2001
93
GB
I have the following XDR trying to map an xml file to a sql database table:-

<?xml version=&quot;1.0&quot; ?>
<Schema xmlns=&quot;urn:schemas-microsoft-com:xml-data&quot;
xmlns:dt=&quot;urn:schemas-microsoft-com:xml:datatypes&quot;
xmlns:sql=&quot;urn:schemas-microsoft-com:xml-sql&quot; >

<ElementType name=&quot;newsID&quot; dt:type=&quot;int&quot; />
<ElementType name=&quot;story&quot; dt:type=&quot;string&quot; />

<ElementType name=&quot;allnews&quot; sql:is-constant=&quot;1&quot;>
<element type=&quot;news&quot; />
</ElementType>

<ElementType name=&quot;news&quot; sql:relation=&quot;News&quot; >
<element type=&quot;newsID&quot; sql:field=&quot;newsID&quot; />
<element type=&quot;story&quot; sql:use-cdata=&quot;1&quot; sql:field=&quot;story&quot; />
<ElementType/>
</Schema>

My problem is within the <story> element there are markup tags such as <i>, <br> etc, which i want it to ignore. I thought using the cdata would solve my problems but on records where there is markup <null> is entered into the database. I was expecting to see something like <![CDATA[story and markup in here!]]>

Where am I going wrong? Should I be using an XSD? what is the difference?

Jo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top