2017年8月20日日曜日

XSLT XPath + MS 仕様 リファレンス用


XPath 構文
  XPath 式のコンテキスト 演算子および特殊文字 コレクション フィルターおよびフィルター パターン 論理式、比較式、およびセット式 比較 セット操作 位置のパス XPath の例

XPath の例
  ./author author first. name /bookstore //author book[/bookstore/@specialty=@style] author/first-name bookstore//title bookstore/*/title bookstore//book/excerpt//emph .//title author/* book/*/last-name */* *[@specialty] @style price/@exchange price/@exchange/total book[@style] book/@style @* ./first-name first-name author[1] author[first-name][3] my:book my:* @my:*
  x/y[1] x/y[position() = 1] (x/y)[1] x[1]/y[2] book[last()] book/author[last()] (book/author)[last()] book[excerpt] book[excerpt]/title book[excerpt]/author[degree] book[author/degree] author[degree][award] author[degree and award] author[(degree or award) and publication] author[degree and not(publication)] author[not(degree or award) and publication] author[last-name = "Bob"] author[last-name[1] = "Bob"] author[last-name [position()=1]= "Bob"] degree[@from != "Harvard"] author[. = "Matthew Bob"] author[last-name = "Bob" and ../price > 50] book[position() <= 3] author[not(last-name = "Bob")] author[first-name = "Bob"] author[* = "Bob"] author[last-name = "Bob" and first-name = "Joe"] price[@intl = "Canada"] degree[position() < 3] p/text()[2] ancestor::book[1] ancestor::book[author][1] ancestor::author[parent::book][1]


  ancestor:: ancestor-or-self:: attribute:: child:: descendant:: descendant-or-self:: following:: following-sibling:: namespace:: parent:: preceding:: preceding-sibling:: self::

ノード型のテスト
  comment() node() processing-instruction() text()

文字列関数 (XPath)
  concat contains normalize-space starts-with String string-length substring substring-after substring-before translate

XML データ型リファレンス
  string boolean decimal float double duration dateTime time date gYearMonth gYear gMonthDay gDay gMonth hexBinary base64Binary anyURI QName NOTATION normalizedString token language IDREFS ENTITIES NMTOKEN NMTOKENS Name NCName ID IDREF ENTITY integer nonPositiveInteger negativeInteger long int short byte nonNegativeInteger unsignedLong unsignedInt unsignedShort unsignedByte positiveInteger

XsltArgumentList.AddExtensionObject
  .AddExtensionObject("urn:Link", link); xmlns:hxLink="urn:Link" exclude-result-prefixes="hxLink" <xsl:value-of select="concat(hxLink:LookupContentId(@NavigateUrl), '.html')"/>

<xsl:element> 要素
  xsl:apply-imports xsl:apply-templates xsl:call-template xsl:choose xsl:copy xsl:copy-of xsl:element xsl:fallback xsl:for-each xsl:if xsl:message xsl:number xsl:otherwise xsl:param xsl:template xsl:text xsl:value-of xsl:variable xsl:when xsl:with-param

Node-Set 関数
  count id last local-name name namespace-uri position

Microsoft XPath 拡張関数
  ms:type-is ms:type-local-name ([node-set]) ms:type-namespace-uri ([node-set]) ms:schema-info-available ms:string-compare ms:utc ms:namespace-uri ms:local-name ms:number ms:format-date ms:format-time

$ は変数


{} は属性値テンプレート