Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Stylesheet problem

From: wookiz@-------.--- (-----)
To: NULL
Date: 2/3/2005 8:49:00 AM
Here is the input xml

<FORM class="show" id="urn:faster:defineProgram"
xmlns:faster="urn:faster">
  <DIV name="root">
    <FIELDSET name="progFrame">
      <LEGEND>Program</LEGEND>

      <DIV name="program">
        <div namespace="faster" urn="urn:faster"
        implementation="file:///C:/FASTER/Build/textInput.htc"
        declareNamespace="declareNamespace" />

        <faster:textInput id="IDA5ARIB" name="shortName"
        frame="progFrame" label="Abbreviation" value="abt">
          <span class="mandatory">
            <div>
              <input title="" onKeyPress="isEnterPressed"
              id="field" onChange="setValue">
                <span class="captions">Abbreviation</span>
              </input>
            </div>
          </span>
        </faster:textInput>

        <faster:textInput id="IDAGBRIB" name="title"
        frame="progFrame" label="Description">
          <span class="mandatory">
            <div>
              <input title="" onKeyPress="isEnterPressed"
              id="field" onChange="setValue">
                <span class="captions">Description</span>
              </input>
            </div>
          </span>
        </faster:textInput>

        <faster:textInput id="IDANBRIB" name="schemaName"
        frame="progFrame" label="Schema Name">
          <span class="mandatory">
            <div>
              <input title="" onKeyPress="isEnterPressed"
              id="field" onChange="setValue">
                <span class="captions">Schema Name</span>
              </input>
            </div>
          </span>
        </faster:textInput>
      </DIV>
    </FIELDSET>

    <FIELDSET name="repositoryFrame">
      <LEGEND>Target Repository</LEGEND>

      <faster:textInput id="IDA3BRIB" name="URI"
      frame="repositoryFrame" label="File Name">
        <span class="mandatory">
          <div>
            <input title="" onKeyPress="isEnterPressed" id="field"
            onChange="setValue" readonly="true" style="width:30em">
              <span class="captions">File Name
              <img onclick="selectFile" title="Select file(s)"
              src="..\icons\files.gif" />
              </span>
            </input>
          </div>
        </span>
      </faster:textInput>
    </FIELDSET>
  </DIV>

  <div namespace="faster" urn="urn:faster"
  implementation="file:///C:/FASTER/Build/error.htc" />

  <faster:error>
  </faster:error>
</FORM>


Here is part of the stylesheet

<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  xmlns:faster="urn:faster"
  exclude-result-prefixes="faster"
  version="1.0">
  <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
  <xsl:param name="namespace"/>
  <xsl:template match="FORM/DIV">
      <xsl:element name="{@name}" namespace="{$namespace}">
	      <xsl:element name="labels" namespace="">
	         <xsl:for-each select="descendant::faster:textInput">
			  <xsl:attribute name="{@name}">
				  <xsl:value-of  select="descendant::span[@class='captions']"/>
			  </xsl:attribute>
		 </xsl:for-each>
	      </xsl:element>
	      <xsl:apply-templates/> 
      </xsl:element>
  </xsl:template>
</xsl:stylesheet>

Here is the output.

<?xml version="1.0"?>
<root xmlns="urn:faster:defineProgram">
<progFrame>
<program>
<shortName>abc</shortName>DescriptionSchema Name</program>
</progFrame>
</root

The problem is that there should be a labels element as the first
child element of the root element.... look at the template matching
FORM/DIV in the stylesheet.

This used to work I have no idea why it has stopped working.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent