Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>An XSLT parameter is different than an XML tag name. Parameters are passed using the tag as described <a href="http://projects.ischool.washington.edu/tabrooks/545/ContentManagement/PassingParameters.htm" rel="nofollow">here</a>. </p> <p>As stated in the comments below, this problem is not too different from what is provided in the link above.</p> <pre><code>StringWriter sw = new StringWriter(); XmlTextWriter w = new XmlTextWriter(sw); w.WriteStartElement("root"); if (!string.IsNullOrEmpty(sWordFileName)) { w.WriteStartElement("attachment", sWordFileName); w.WriteAttributeString("name", sWordFileName); w.WriteEndElement(); } if (!string.IsNullOrEmpty(sPDFFileName)) { w.WriteStartElement("attachment"); w.WriteAttributeString("name", sPDFFileName); w.WriteEndElement(); } w.WriteEndElement(); w.Close(); XPathDocument doc = new XPathDocument(new StringReader(sw.ToString())); XPathNavigator nav = doc.CreateNavigator(); XsltArgumentList xslArg = new XsltArgumentList(); xslArg.AddParam("attachment","",nav); </code></pre> <p>Here would be XSL to match per <a href="http://www.dpawson.co.uk/xsl/sect2/N5982.html#d8188e46" rel="nofollow">Accessing parameters which contain mark-up</a>:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet version="2.0" xmlns:xsl="w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:my-scripts="urn:my-scripts" xmlns="factiva.com/fcs/schemas/newsSummaries"&gt; &lt;xsl:param name="attachment" /&gt; &lt;xsl:template match="/"&gt; &lt;xsl:apply-templates select="$attachment"/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="attachment"&gt; &lt;a target="_blank" href="{@name}"&gt;{@name}&lt;/a&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload