G
Guest
Hi,
I am trying to build reusable templates for user input forms, and then
just use XSL to generate the forms...but I cannot get my xsl to match
any templates, and the output is fine.
here is my xml in full:<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"
href="http://lxsjfk1is1/ssrinterface/devutils/myform.xsl"?>
<fields>
<field>
<name>lAccount_Num</name>
<caption>Account Number:</caption>
<type>label</type>
<size></size>
<style>LEFT: 17px; WIDTH: 112px; POSITION: absolute; TOP: 13px;
HEIGHT: 18px</style>
<FOR>tAccount_Num</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>tAccount_Num</name>
<caption></caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 127px; WIDTH: 165px; POSITION:
absolute; TOP: 13px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>15</maxLength>
<value/>
</field>
<field>
<name>tCRY</name>
<caption></caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 400px; WIDTH: 50px; POSITION:
absolute; TOP: 13px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>3</maxLength>
<value/>
</field>
<field>
<name>lCRY</name>
<caption>Currency:</caption>
<type>label</type>
<size></size>
<style>LEFT: 330px; WIDTH: 120px; POSITION: absolute; TOP: 13px;
HEIGHT: 18px</style>
<FOR>tCRY</FOR>
<maxLength>3</maxLength>
<value/>
</field>
<field>
<name>lAccount_Name</name>
<caption>Account Name:</caption>
<type>label</type>
<size></size>
<style>LEFT: 17px; WIDTH: 108px; POSITION: absolute; TOP: 40px;
HEIGHT: 18px</style>
<FOR>tAccount_Num</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>tAccount_Name</name>
<caption></caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 127px; WIDTH: 325px; POSITION:
absolute; TOP: 40px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>75</maxLength>
<value/>
</field>
<field>
<name>lbranch_code</name>
<caption>Branch Code:</caption>
<type>label</type>
<size></size>
<style>LEFT: 17px; WIDTH: 112px; POSITION: absolute; TOP: 80px;
HEIGHT: 18px</style>
<FOR>tbranch_code</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>tbranch_code</name>
<caption>Branch Code</caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 127px; WIDTH: 135px; POSITION:
absolute; TOP: 80px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>8</maxLength>
<value/>
</field>
<field>
<name>lEnabled</name>
<caption>Enabled:</caption>
<type>label</type>
<size></size>
<style>LEFT: 330px; WIDTH: 120px; POSITION: absolute; TOP: 80px;
HEIGHT: 18px</style>
<FOR>chEnable</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>chEnable</name>
<caption></caption>
<type>Checkbox</type>
<size></size>
<style>LEFT: 402px; WIDTH: 16px; POSITION: absolute; TOP: 80px;
HEIGHT: 22px</style>
<FOR></FOR>
<maxLength></maxLength>
<value/>
</field>
</fields>
</xml>
<<< END OF XML <<<
and here is my XSL file in full:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="field">
<xsl:choose>
<xsl:when match=".[type='Text']">
<input type="text">
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:if test=".[width!='']">
<xsl:attribute name="maxlength">
<xsl:value-of select="width"/>
</xsl:attribute>
</xsl:if>
</input>
</xsl:when>
<xsl:when match=".[type='label']">
<label>
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute for="FOR">
<xsl:value-of select="for"/>
</xsl:attribute>
<xsl:attribute for="style">
<xsl:value-of select="style"/>
</xsl:attribute>
<xsl:if test=".[maxlength!='']">
<xsl:attribute name="maxlength">
<xsl:value-of select="maxlength"/>
</xsl:attribute>
</xsl:if>
<xsl:if test=".[size!='']">
<xsl:attribute name="size">
<xsl:value-of select="size"/>
</xsl:attribute>
</xsl:if>
<!-- CAPTION for Label -->
<xsl:value-of select="caption"/>
</label>
</xsl:when>
<xsl:when match=".[type='Checkbox']">
<input type="checkbox">
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute for="style">
<xsl:value-of select="style"/>
</xsl:attribute>
</input>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<<<< END OF XSL <<<<
both validate fine using MS XML4 Processor...using IE 6 on Windows 2000.
please point me in the right direction, thanks
Philip
I am trying to build reusable templates for user input forms, and then
just use XSL to generate the forms...but I cannot get my xsl to match
any templates, and the output is fine.
here is my xml in full:<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl"
href="http://lxsjfk1is1/ssrinterface/devutils/myform.xsl"?>
<fields>
<field>
<name>lAccount_Num</name>
<caption>Account Number:</caption>
<type>label</type>
<size></size>
<style>LEFT: 17px; WIDTH: 112px; POSITION: absolute; TOP: 13px;
HEIGHT: 18px</style>
<FOR>tAccount_Num</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>tAccount_Num</name>
<caption></caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 127px; WIDTH: 165px; POSITION:
absolute; TOP: 13px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>15</maxLength>
<value/>
</field>
<field>
<name>tCRY</name>
<caption></caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 400px; WIDTH: 50px; POSITION:
absolute; TOP: 13px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>3</maxLength>
<value/>
</field>
<field>
<name>lCRY</name>
<caption>Currency:</caption>
<type>label</type>
<size></size>
<style>LEFT: 330px; WIDTH: 120px; POSITION: absolute; TOP: 13px;
HEIGHT: 18px</style>
<FOR>tCRY</FOR>
<maxLength>3</maxLength>
<value/>
</field>
<field>
<name>lAccount_Name</name>
<caption>Account Name:</caption>
<type>label</type>
<size></size>
<style>LEFT: 17px; WIDTH: 108px; POSITION: absolute; TOP: 40px;
HEIGHT: 18px</style>
<FOR>tAccount_Num</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>tAccount_Name</name>
<caption></caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 127px; WIDTH: 325px; POSITION:
absolute; TOP: 40px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>75</maxLength>
<value/>
</field>
<field>
<name>lbranch_code</name>
<caption>Branch Code:</caption>
<type>label</type>
<size></size>
<style>LEFT: 17px; WIDTH: 112px; POSITION: absolute; TOP: 80px;
HEIGHT: 18px</style>
<FOR>tbranch_code</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>tbranch_code</name>
<caption>Branch Code</caption>
<type>Text</type>
<size></size>
<style>FONT-SIZE: xx-small; LEFT: 127px; WIDTH: 135px; POSITION:
absolute; TOP: 80px; HEIGHT: 18px</style>
<FOR></FOR>
<maxLength>8</maxLength>
<value/>
</field>
<field>
<name>lEnabled</name>
<caption>Enabled:</caption>
<type>label</type>
<size></size>
<style>LEFT: 330px; WIDTH: 120px; POSITION: absolute; TOP: 80px;
HEIGHT: 18px</style>
<FOR>chEnable</FOR>
<maxLength></maxLength>
<value/>
</field>
<field>
<name>chEnable</name>
<caption></caption>
<type>Checkbox</type>
<size></size>
<style>LEFT: 402px; WIDTH: 16px; POSITION: absolute; TOP: 80px;
HEIGHT: 22px</style>
<FOR></FOR>
<maxLength></maxLength>
<value/>
</field>
</fields>
</xml>
<<< END OF XML <<<
and here is my XSL file in full:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="field">
<xsl:choose>
<xsl:when match=".[type='Text']">
<input type="text">
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:if test=".[width!='']">
<xsl:attribute name="maxlength">
<xsl:value-of select="width"/>
</xsl:attribute>
</xsl:if>
</input>
</xsl:when>
<xsl:when match=".[type='label']">
<label>
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute for="FOR">
<xsl:value-of select="for"/>
</xsl:attribute>
<xsl:attribute for="style">
<xsl:value-of select="style"/>
</xsl:attribute>
<xsl:if test=".[maxlength!='']">
<xsl:attribute name="maxlength">
<xsl:value-of select="maxlength"/>
</xsl:attribute>
</xsl:if>
<xsl:if test=".[size!='']">
<xsl:attribute name="size">
<xsl:value-of select="size"/>
</xsl:attribute>
</xsl:if>
<!-- CAPTION for Label -->
<xsl:value-of select="caption"/>
</label>
</xsl:when>
<xsl:when match=".[type='Checkbox']">
<input type="checkbox">
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute for="style">
<xsl:value-of select="style"/>
</xsl:attribute>
</input>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
<<<< END OF XSL <<<<
both validate fine using MS XML4 Processor...using IE 6 on Windows 2000.
please point me in the right direction, thanks
Philip