をサポートしていませんWindows用Universal Platform 10に含まれているWindow.Data.Xml.Dom名前空間を使用してXMLファイルをロードしようとしています。私の問題は、明らかに私はXMLにXMLをロードしようとするということであるWindow.Data.Xml.Dom.XmlDocumentは<!Doctypeまたは<!CDATA
var xslfile = Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(xslFilePath)
.GetAwaiter().GetResult();
var xslDocument = XmlDocument.LoadFromFileAsync(xslfile).GetAwaiter().GetResult();
var xsltPocessor = new Windows.Data.Xml.Xsl.XsltProcessor(xslDocument);
var xmlDocumentToTransform = new XmlDocument();
xmlDocumentToTransform.LoadXml(xmlToTransform);
var generatedHtml = xsltPocessor.TransformToString(xmlDocumentToTransform);
:その後、私はXSTLTranslator
を使用して、このXMLを変換する必要があるので、私はことを実現するために、次のコードを使用していますことをしなければなりません
の文書var xmlDocumentToTransform = new XmlDocument();
xmlDocumentToTransform.LoadXml(xmlToTransform);
変換する前にエラー0xC00CE584が発生します。以下のXMLの例を参照してください:
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE dmodule[
<!NOTATION cgm PUBLIC "-//USA-DOD//NOTATION Computer Graphics Metafile//EN">
<!NOTATION jpeg PUBLIC "+//ISBN 0-7923-9432-1::Graphic Notation//NOTATION
Joint Photographic Experts Group Raster//EN">
<!NOTATION swf PUBLIC "-//S1000D//NOTATION X-SHOCKWAVE-FLASH 3D Models
Encoding//EN">
<!NOTATION png PUBLIC "-//W3C//NOTATION Portable Network Graphics//EN">
]>
<dmodule xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dc="http://www.purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi:noNamespaceSchemaLocation="http://www.s1000d.org/S1000D_4-
1/xml_schema_flat/proced.xsd">
<rdf:Description>
<dc:title>Tire - Remove and install a new item</dc:title>
</rdf:Description>
</dmodule>
私はすぐに私はこの情報を削除するように私は、XMLを解析し、エラーを持っていないため、エラーがヘッダー内のDOCTYPEノードから来ていると思います!と。これは予想される動作かバグですか?古典的な.Netではこのエラーは発生しません。
PS:XMLSあなたはのtry-catchでコードをラップする場合は、あなたがより多くの記述にエラーが表示されるはずですS1000D仕様例
をhttps://stackoverflow.com/questions/13854068/dtd -prohibited-in-xml-document-exception XmlReaderSettings設定=新しいXmlReaderSettings(); settings.DtdProcessing = DtdProcessing.Parse; –