Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you trying to process the transformation by opening the XML in a web browser?</p> <p>If you are, what you're seeing is the browsers attempt to render the output after the transform is complete. Since the browser has no idea how to display vxml, you only see text nodes.</p> <p>What would help is for you to use an XSLT processor. I'd recommend <a href="http://saxon.sourceforge.net/" rel="nofollow">Saxon</a>. Saxon-HE would be perfect to get you started. The documentation should easily get you running transforms from the command line.</p> <p>I added another XSLT 1.0 example you can use. The most important piece is the identity template. This will copy all nodes (text/elements/comments/processing instructions) and attributes as-is without modification (as long as they are not overridden by another template). Just add new templates if you need to override the identity template.</p> <p>Also, I stole Franci Avila's <code>id</code> creation but used an <a href="http://www.w3.org/TR/xslt#attribute-value-templates" rel="nofollow">AVT</a> instead of <code>xsl:attribute</code>. I did this just to show an AVT. AVTs are also <em>very</em> handy to learn.</p> <p><strong>XML Input</strong> (I removed the <code>xml-stylesheet</code> PI from the input. If I didn't remove it, I'd have to override the identity template to strip it.)</p> <pre><code>&lt;myProjtag&gt; &lt;prompt&gt;I am here&lt;/prompt&gt; &lt;prompt&gt;I am not here&lt;/prompt&gt; &lt;/myProjtag&gt; </code></pre> <p><strong>XSLT 1.0</strong></p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output indent="yes"/&gt; &lt;xsl:strip-space elements="*"/&gt; &lt;!--Identity tempate.--&gt; &lt;xsl:template match="node()|@*"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="node()|@*"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="/"&gt; &lt;vxml version="2.0" lang="en"&gt; &lt;form id="{substring(local-name(/*), 0, string-length(local-name(/*))-2)}"&gt; &lt;xsl:apply-templates select="*/*"/&gt; &lt;/form&gt; &lt;/vxml&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>XML Output</strong></p> <pre><code>&lt;vxml version="2.0" lang="en"&gt; &lt;form id="myProj"&gt; &lt;prompt&gt;I am here&lt;/prompt&gt; &lt;prompt&gt;I am not here&lt;/prompt&gt; &lt;/form&gt; &lt;/vxml&gt; </code></pre> <p>If you have any questions on the XSLT, running Saxon from the command line, etc., just let me know.</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    1. This table or related slice is empty.
    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