XML编码格式转换问题,急!!!
我要在网页上上传一个XML文件,我在C#中写了一个验证XML文件格式的方法:
private bool ValidateXml(string xmlFilePath)
{
string xsdPath = Request.PhysicalApplicationPath + @"Files\example\rcpt.xsd";
//使用xmlReader验证XML格式
// Set the validation settings.
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
settings.Schemas.Add(null, xsdPath);
settings.ValidationFlags |= XmlSchemaValidationFlags.ProcessInlineSchema;
settings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings;
settings.ValidationEventHandler += new ValidationEventHandler(settings_ValidationEventHandler);
// Create the XmlReader object.
XmlReader reader = XmlReader.Create(xmlFilePath, settings);
// Parse the file.
try
{
while (reader.Read());
}
catch (Exception ex)
&nb
相关问答:
我在编写一个wince5.0的程序,想实现把PDA上的一个LIST <STRING>类型的数据序列化为XML,然后在PC上的一个webservice拿到这个XML,转化为Dataset,更新PC上的数据库,我想问怎么把XML传给webservice的呢?
......
如何将一个XML文件转化为一种标准的格式化的XML文件结构
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<STU>
<ROWNUM>1</ROWNUM>
&n ......
我有一个类似的xml的 string,想通过遍历怎么个xml 输出我想要的element的值
xml 为:
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_XML_ME ......
现在有个xml文件是<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xm ......
请高手指教用java实现根据xsd文件生成xml文件,小弟初学希望能给个实例!谢谢!
期待高手指教!!!!!!!!
没人知道吗。。。。。。。。。。
引用
schema xsd 文件是用于验证 XML 格式的,并不是用于生 ......