I am creating a punchout enabled site, and using catalogindex file to
import to database. the supplier will upload an xml file in cxml
format. i have to validate it against
http://xml.cXML.org/schemas/cXML/1.2.014/cXML.dtd . i am using asp.net
1.1 with c# . the catalog index file is:
<?xml version="1.0"?>
<!DOCTYPE cXML SYSTEM
"http://xml.cXML.org/schemas/cXML/1.2.014/cXML.dtd">
<Index>
<SupplierID />
<Comments />
<IndexItem>
<IndexItemAdd>
<ItemId>
<SupplierPartID>100</SupplierPartID>
</ItemId>
<ItemDetail>
<UnitPrice>
<Currency>300$</Currency>
</UnitPrice>
<Description>aaaaaaaaaaaaaaa</Description>
<UnitOfMeasure>700</UnitOfMeasure>
<Classification>800</Classification>
<ManufacturePartID>MSB3.12</ManufacturePartID>
<ManufactureName>Florshim</ManufactureName>
<url>htt://localhost/ex.htm</url>
<Extrinsic>1500</Extrinsic>
</ItemDetail>
<IndexItemDetail>
<Leadtime>10</Leadtime>
<ExpirationDate>1/10/2005 12:00:00
AM</ExpirationDate>
<EffectiveDate>1/11/2005 12:00:00
AM</EffectiveDate>
<TerritoryAvailable>ddddd</TerritoryAvailable>
</IndexItemDetail>
</IndexItemAdd>
</IndexItem>
<IndexItem>
<IndexItemAdd>
<ItemId>
<SupplierPartID>101</SupplierPartID>
</ItemId>
<ItemDetail>
<UnitPrice>
<Currency>500$</Currency>
</UnitPrice>
<Description>rrrrrrrrrrrrrrrrrrrrr</Description>
<UnitOfMeasure>701</UnitOfMeasure>
<Classification>801</Classification>
<ManufacturePartID>msb4.5</ManufacturePartID>
<ManufactureName>Florshim</ManufactureName>
<url>http://localhost/catalog.aspx</url>
<Extrinsic>1501</Extrinsic>
</ItemDetail>
<IndexItemDetail>
<Leadtime>20</Leadtime>
<ExpirationDate>1/10/2005 12:00:00
AM</ExpirationDate>
<EffectiveDate>11/11/2005 12:00:00
AM</EffectiveDate>
<TerritoryAvailable>ggggg</TerritoryAvailable>
</IndexItemDetail>
</IndexItemAdd>
</IndexItem>
</Index>
for validation in c# :
=============
private bool ValidateFile(string xmlFile)
{
XmlTextReader xmlTxtRdr = new XmlTextReader(xmlFile);
XmlValidatingReader xmlValidRdr = new
XmlValidatingReader(xmlTxtRdr);
xmlValidRdr.ValidationType=ValidationType.DTD;
xmlValidRdr.ValidationEventHandler += new
ValidationEventHandler(XmlValidationEventHandler);
try
{
while (xmlValidRdr.Read())
{
}
}
finally
{
xmlValidRdr.Close();
}
return isXmlFileValid;
}
its giving error:
=========
The parameter entity replacement text must nest properly within markup
declarations. An error occurred at
http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd, (3835, 79).
can anyone tell me how to solve this.
thanks,
amiya
Assuming this is not an error in the DTD you will have to modify the DTD
to interoperate with MSXML, http://www.w3.org/2002/04/xml_bugs/#bug2 is
a known MSXML bug.
--
Björn Höhrmann · mailto:bjo...@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
can you tell me what is wrong in this line or what i have to edit.
thanks n regards,
Amiya