开发者

how to output all the xml in xls?

开发者 https://www.devze.com 2023-03-13 01:27 出处:网络
I\'m trying to develop a webpart for SharePoint, and it seems I need to learn XSLT to do it, modifying the itemsStyle.xsland customizing a contentquery.webpart.

I'm trying to develop a webpart for SharePoint, and it seems I need to learn XSLT to do it, modifying the itemsStyle.xsland customizing a contentquery.webpart.

I'm adding a templates to my current itemsStyle.xsl, here's my current code :

I'm trying to make the output the whole XML files because I don't know how it is formatted (I dunno where SharePoint takes it)

So far, I can output the attribute name trough name(), but text() return nothing :

<xsl:template name="printP" match="Row[@Style='printP']" mode="itemstyle">
  <xsl:for-each select="@*">
    Property:<xsl:value-of select="开发者_Go百科name()"/> |
    Value:<xsl:value-of select="text()"/><br/>
  </xsl:for-each>
</xsl:template>

Any other suggestion on how to figure out the XML format is welcome.

edit: removed useless part.


To output the value of an attribute node, use select=".":

Value:<xsl:value-of select="."/>

text() selects any text nodes that are children of the current node. Only element nodes have text node children; attributes do not.

However, if what you're trying to do is copy the full input XML document to the output, unchanged, then throw all those templates away and use the identity transform:

<!-- Identity transform -->
<xsl:template match="@* | node()">
   <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
   </xsl:copy>
</xsl:template>

This will copy everything through, unchanged (as XML, not text).


I can output the attribute name trough name(), but text() return nothing

<xsl:for-each select="@*">
    Property:<xsl:value-of select="name()"/> |
    Value:<xsl:value-of select="."/><br/>
</xsl:for-each>
0

精彩评论

暂无评论...
验证码 换一张
取 消