This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Value Extraction Problem
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] Value Extraction Problem
- From: P Vikram <vikram_good_boy at yahoo dot com>
- Date: Wed, 5 Sep 2001 14:52:28 -0700 (PDT)
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi
Iam unable to populate my textbox with value.My code
is as follows:
Iam able to get the value with
alert(testXML.documentElement.selectSingleNode("//TEST").text);
<?xml version="1.0" ?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns="http://www.w3.org/TR/REC-html40">
<xsl:template match="/">
<xsl:apply-templates select="//TESTDATA"/>
</xsl:template>
<xsl:template match="TESTDATA">
<xsl:apply-templates select="//DETAILS"/>
</xsl:template>
<xsl:template match="DETAILS">
<xsl:apply-templates select="//TABLE"/>
</xsl:template>
<xsl:template match="TABLE">
<INPUT maxLength="7" name="test" size="14">
<xsl:attribute name="value">
<xsl:value-of select="TEST"/>
</xsl:attribute>
</INPUT>
</xsl:template>
</xsl:stylesheet>
function test() {
var xslFile;
testXSL.async = false;
xslFile = "test.xsl";
testXSL.load(xslFile);
rcXSL = titleXSL.parseError.errorCode;
//alert(rcXSL);
tdata = titleXSL.parseError.reason;
//alert(tdata);
rcXML = titleXML.parseError.errorCode;
if (rcXSL+rcXML == 0)
{
optHTML =
testXML.documentElement.transformNode(testXSL.documentElement);
}
document.all.item("test").innerHTML=optHTML;
}
<XML id="testXSL"></XML>
//this is runtime display from view source..i want
//iwantthisvalue to be populated in my textbox
<XML id="testXML">
<TESTDATA>
<DETAILS>
<TABLE>
<TEST>iwantthisvalue</TEST>
</TABLE>
</DETAILS>
</TESTDATA>
Thanks
</XML>
--- Joseph Kesselman <keshlam@us.ibm.com> wrote:
>
> The input to XSLT must be well-formed XML. XML
> requires that all attribute
> values be quoted, and all elements be terminated.
> Rewrite your literal
> element in XHTML -- change
> <INPUT maxLength=7 name=test size=14>
> to
> <INPUT maxLength="7" name="test" size="14">
> and be sure you have a </INPUT> after the
> <xsl:attribute> block.
>
> ______________________________________
> Joe Kesselman / IBM Research
>
>
> XSL-List info and archive:
> http://www.mulberrytech.com/xsl/xsl-list
>
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list