ノURLを解決しない場合への対応言えないさまざまな研究施@id値

StackOverflow https://stackoverflow.com/questions/4225639

  •  26-09-2019
  •  | 
  •  

質問

悔しい問題XInclude/ノます。

その目的は、などの作品のリストからXML形式の価格-選別ます。私は文書のリストを価格に見えるようになります:

 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE preise [
   <!ELEMENT preise (preis+)>
   <!ELEMENT preis (#PCDATA)>
   <!ATTLIST preis id ID #REQUIRED>
 ]>
 <preise>
   <preis id="a0">./.</preis>
 <preis id='foo100'>136,10</preis>
 <preis id='foo101'>163,32</preis>
 </preise>

以下のを含む合

 <xi:include href="../listen/preise.xml#xpointer(/preise/preis[@id='foo100']/text())" />

 element include: XInclude error : failed build URL

今を変更した場合、購入したのフォーマットidのリストのみの数値

 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE preise [
   <!ELEMENT preise (preis+)>
   <!ELEMENT preis (#PCDATA)>
   <!ATTLIST preis id ID #REQUIRED>
 ]>
 <preise>
   <preis id="a0">./.</preis>
 <preis id='100'>136,10</preis>
 <preis id='101'>163,32</preis>
 </preise>

使用などのアポストロフィ

 <xi:include href="../listen/preise.xml#xpointer(/preise/preis[@id=100]/text())" />

突然のものです。それでは何が問題かというともにアポストロフィがどうやっていけばいいですか?周辺ょうか。

また、ここでの私のxmllint版情報:

 xmllint: using libxml version 20706
    compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib
役に立ちましたか?

解決

から XInclude W3C仕様:

のxi:include要素の 以下の属性は:

href

値の後、適切な 脱出(4.1.1の脱出のhref 属性値が実行され 結果のURI参照、又は入 参照を指定する場所 のリソースが含まれています。のhref 属性はオプション;有 この属性と同じ 指定href=""の 参照が同じドキュメントの場合 にhref属性を欠席の場合 parse="xml"、属性ノ が存在している必要があります。 片 識別子を使うことはできません;その 外観は致命的なエラーです。 値 その結果構文上 無効なURIまたは入できないことがありますので として致命的なエラーがあ 実装してご使用いただくことも可能 めることができる場合 からの資源エラーになります。

そこで、"片識別子を使うことはできません;その外観は致命的なエラーです。"

:みを省略 href 属性および使用の xpointer 属性。

しかし, この 以下のテキスト 同じスペック:

支援のノノ()スキーム"が義務づけられていませんの全XIncludeを設定します.著者ご使用のノ()その他のノスキーム以外の要素()のような すべてconformant XIncludeの実装

最後に、 ここでは一例ですから、仕様の 使ノ断片を含有:

以下の図の結果を含む断片の他式のXML文書です。ついて ベースURIの書類ではあ http://www.example.com/JoeSmithQuote.xml.

<?xml version='1.0'?>
<price-quote xmlns:xi="http://www.w3.org/2001/XInclude">
  <prepared-for>Joe Smith</prepared-for>
  <good-through>20040930</good-through>
  <xi:include href="price-list.xml" xpointer="w002-description"/>
  <volume>40</volume>
  <xi:include href="price-list.xml" xpointer="element(w002-prices/2)"/>
</price-quote>

price-list.xml 参考文献DTDを宣言するのid属性としてのタイプIDを含ん:

<?xml version='1.0'?>
<!DOCTYPE price-list SYSTEM "price-list.dtd">
<price-list xml:lang="en-us">
  <item id="w001">
    <description id="w001-description">
      <p>Normal Widget</p>
    </description>
    <prices id="w001-prices">
      <price currency="USD" volume="1+">39.95</price>
      <price currency="USD" volume="10+">34.95</price>
      <price currency="USD" volume="100+">29.95</price>
    </prices>
  </item>
  <item id="w002">
    <description id="w002-description">
      <p>Super-sized widget with bells <i>and</i> whistles.</p>
    </description>
    <prices id="w002-prices">
      <price currency="USD" volume="1+">59.95</price>
      <price currency="USD" volume="10+">54.95</price>
      <price currency="USD" volume="100+">49.95</price>
    </prices>
  </item>
</price-list>

のinfosetによる介在物の解決この文書は、同一のを除く などの歴史と言語の特性としては、下記の書類:

<?xml version='1.0'?>
<price-quote xmlns:xi="http://www.w3.org/2001/XInclude">
  <prepared-for>Joe Smith</prepared-for>
  <good-through>20040930</good-through>
  <description id="w002-description" xml:lang="en-us"
               xml:base="http://www.example.com/price-list.xml">
    <p>Super-sized widget with bells <i>and</i> whistles.</p>
  </description>
  <volume>40</volume>
  <price currency="USD" volume="10+" xml:lang="en-us"
         xml:base="http://www.example.com/price-list.xml">54.95</price>
</price-quote>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top