0
私はC#を使用してxmlファイル内のテキストを読み込んで抽出する良い方法を探しています。私はここで-w:t xml:space="preserve- XXXX -/w:t-
C#を使用してこの種のXMLファイルを読み取る方法は?
内のテキストを連結する
は、ファイルのサンプルです:
<w:body>
<w:sdt xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:sdtPr>
<w:rPr>
<w:b />
<w:bCs />
<w:noProof />
</w:rPr>
<w:alias w:val="Business Rule" />
<w:tag w:val="urn:ILOG.RuleDoc.3:Rule_a9e5674c-7145-4bfb-af53-524543e98358" />
<w:id w:val="8959571" />
</w:sdtPr>
<w:sdtContent>
<w:p w:rsidR="00711D98" w:rsidRDefault="00711D98" w:rsidP="00711D98">
<w:pPr>
<w:pStyle w:val="Rule" />
<w:rPr>
<w:b />
<w:bCs />
<w:noProof />
</w:rPr>
</w:pPr>
</w:p>
<w:p w:rsidR="00711D98" w:rsidRPr="00C95F62" w:rsidRDefault="00711D98" w:rsidP="00711D98">
<w:sdt>
<w:sdtPr>
<w:rPr>
<w:rStyle w:val="Heading3Char" />
<w:noProof />
</w:rPr>
<w:alias w:val="Name" />
<w:tag w:val="urn:ILOG.RuleDoc.3:RuleProperty" />
<w:id w:val="7323368" />
<w:dataBinding w:prefixMappings="xmlns:ns0='http://schemas.ilog.com/Rules/3.0/RuleDocumentData' xmlns:ns1='http://schemas.ilog.com/Rules/1.1/Properties' xmlns:ns2='urn:Intellinsure'" w:xpath="//ns0:ActionRule/ns0:Properties/ns1:Uuid[.='a9e5674c-7145-4bfb-af53-524543e98358']/../ns1:Name" w:storeItemID="{00000000-0000-0000-0000-000000000000}" />
<w:text />
</w:sdtPr>
<w:sdtContent>
<w:r>
<w:rPr>
<w:rStyle w:val="Heading3Char" />
</w:rPr>
<w:t>New Rule 9</w:t>
</w:r>
</w:sdtContent>
</w:sdt>
</w:p>
<w:p w:rsidR="00711D98" w:rsidRPr="0032004A" w:rsidRDefault="00711D98" w:rsidP="00711D98">
<w:pPr>
<w:pStyle w:val="Rule" />
</w:pPr>
</w:p>
<w:sdt>
<w:sdtPr>
<w:alias w:val="Rule Body" />
<w:tag w:val="urn:ILOG.RuleDoc.3:RuleBody" />
<w:id w:val="9275215" />
</w:sdtPr>
<w:sdtContent xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
<w:p>
<w:pPr>
<w:pStyle w:val="RuleBody" />
</w:pPr>
<w:r>
<w:rPr>
<w:rStyle w:val="RuleBodyNormal" />
</w:rPr>
<w:t xml:space="preserve">definitions</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:pStyle w:val="RuleBody" />
</w:pPr>
<w:r>
<w:tab />
</w:r>
<w:r>
<w:rPr>
<w:rStyle w:val="RuleBodyNormal" />
</w:rPr>
<w:t xml:space="preserve">set 'subscriber' to an actor in the subscribers to "Contract-Name" in 'the request' ;</w:t>
</w:r>
</w:p>
<w:p>
<w:pPr>
<w:pStyle w:val="RuleBody" />
</w:pPr>
<w:r>
<w:tab />
</w:r>
<w:r>
<w:rPr>
<w:rStyle w:val="RuleBodyNormal" />
</w:rPr>
<w:t xml:space="preserve">set 'excludedSubscribersList' to the excluded subscribers to "Contract-Name" in 'the request' ;</w:t>
</w:r>
</w:p>
それはのようなものを与える必要があります:アクターへ
定義
セットの加入者を契約者の契約名へ の除外された加入者にexcludedSubscribersList
を '要求'に設定します。
ありがとうございました。 XmlReader
を使用して
感謝を:与え
。 もう少し質問をすることができます: 属性xml:space = "preserve"がないので、新しいルール9を避けるために離れていますか? この行の目的は次のとおりです。nsmgr.AddNamespace( "w"、 "urn:http://mynamespace.owner.com"); ? ありがとうございます。 –
xml属性のフィルタで回答を更新しました。提供されたXMLがうまく構成されていないので、名前空間 'w'を指定する必要があります。 ''は 'にする必要があります。 '。この宣言がなければ、 'body'要素に対して名前空間' w'が宣言されていないため、パーサはExceptionを発生させます。 –