Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Stylesheet problem Stylesheet problemTo: 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.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
