Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl accompany with xml

Status
Not open for further replies.

zhshqzyc

Programmer
Jan 21, 2006
13
US
Hello,
I am a real newbin for xsl.
Usually xsl is refered to xhtml or so. And the files are seperated. But how to understand this code?
The xml and xsl are merged together.
Code:
 <Application Name="MgmtMenu" Type="Class" ClassName="MenuOnly" Authorize="False" CheckPoint="True" FeatureID="260">
    <Input Name="Instructions" Static="yes">Select Option</Input>
    <Input Name="Title" Static="yes">Management Menu</Input>
    <Input Name="Menu" Static="yes">MgmtMenu</Input>
    <ProgID>Misc.dll</ProgID>
    <Output Name="Status" Type="String" Static="no" />
    <Output Name="Type" Static="yes">Default</Output>
    <Output Name="RunMenu" Static="yes">BtnShow</Output>
    <Output Name="Next" Static="yes" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform"[/URL] version="1">
      <xsl:transform version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
        <xsl:output method="text" />
        <xsl:template match="/">
          <xsl:choose>
            <xsl:when test="(/Configuration/GlobalArea/Variable[@Name='Status']) = 'MenuItemEscape'">
              <xsl:copy>AdminMenu</xsl:copy>
            </xsl:when>
            <xsl:when test="(/Configuration/GlobalArea/Variable[@Name='Status']) = 'MenuItemAssign'">
              <xsl:copy>Assign</xsl:copy>
            </xsl:when>
            <xsl:when test="(/Configuration/GlobalArea/Variable[@Name='Status']) = 'MenuItemFinal'">
              <xsl:copy>Reconcile_OperID</xsl:copy>
            </xsl:when>
            <xsl:otherwise>
              <xsl:copy></xsl:copy>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:template>
      </xsl:transform>
    </Output>
  </Application>
Thanks for your time.
 
>Usually xsl is refered to xhtml or so.
No, not usually nor not rarely. It is just making not much sense. It is a highly distorted idea. It can happen if the author sees fit.

>But how to understand this code?
>The xml and xsl are merged together.
Xslt document is by itself an xml document. It can appear inside an xml document, sure. The xml document as shown can legitimately, as the author sees fit, transmit to its recipients a piece of information, namely, an xslt document destined for some use to some application. And that piece of information is embedded within it as the author sees fit. You can also embedded as well a schema document or documents or any other documents with specific namespaces, public or proprietary, as long as the application/recipient can understand. I hope that makes the idea sufficiently clear in this regard.
 
Thanks.
You know xsl means transforming something into xml.
If instead of using it, how to interpret the above code by pure xml?
A piece of code is enough such as <xsl:copy>Assign</xsl:copy>
 
>You know xsl means transforming something into xml.
Be careful if you want a general statement. It is not quite right.

>If instead of using it, how to interpret the above code by pure xml?
>A piece of code is enough such as <xsl:copy>Assign</xsl:copy>
An xml parser would parse it... Reporting events if it is a sax reader. Parsing it into memory as infoset if it is a dom parser. And then, nothing. It is thereafter, up to the application to decide what to use. It may load up an xsl processor and feed with it the part pertinent to it such as that blog with <xsl:copy> element etc...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top