beaniebear
Programmer
I have the following XDR trying to map an xml file to a sql database table:-
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<ElementType name="newsID" dt:type="int" />
<ElementType name="story" dt:type="string" />
<ElementType name="allnews" sql:is-constant="1">
<element type="news" />
</ElementType>
<ElementType name="news" sql:relation="News" >
<element type="newsID" sql:field="newsID" />
<element type="story" sql:use-cdata="1" sql:field="story" />
<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
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<ElementType name="newsID" dt:type="int" />
<ElementType name="story" dt:type="string" />
<ElementType name="allnews" sql:is-constant="1">
<element type="news" />
</ElementType>
<ElementType name="news" sql:relation="News" >
<element type="newsID" sql:field="newsID" />
<element type="story" sql:use-cdata="1" sql:field="story" />
<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