XSLT with DOM
sunker at telkom.net
sunker at telkom.net
Thu Dec 9 02:46:53 GMT 1999
Hi all,
I got a problem with Dom doc with xsl transform
in my xml i included the DTD with the entity references to some file process such as test.asp, (i parse with GenXMLToHTML(xml,xsl)) when it display to the web browser, its blank...!!.
but when i include stylesheet directly to xml file it work properly. why ?.. Is it possible xml cannot load the process under process ? or the xsl is worst processor ?
for more info this the example:
DOM TRANS XML TO HTML:
function GenXMLToHTML(xmlf,xslf)
{
xmlfile = new ActiveXObject("Microsoft.XMLDOM");
xmlfile.async = false;
xmlfile.validateOnParse = false;
xmlfile.load(Server.MapPath(xmlf));
xslfile = new ActiveXObject("Microsoft.XMLDOM");
xslfile.async = false;
xslfile.validateOnParse = false;
xslfile.load(Server.MapPath(xslf));
Response.Write(xmlfile.transformNode(xslfile));
}
=======================================
XML FILENAME = TEST.XML
<?xml version="1.0"?>
<!DOCTYPE TRADING[
<!ELEMENT TRADING (Roots?)>
<!ELEMENT Roots (Pale*)>
<!ELEMENT Pale (#PCDATA)>
<!ENTITY port SYSTEM "test.asp">
]>
<TRADING>
&port;
</TRADING>
=======================================
XSL FILENAME = TEST.XSL
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40" result-ns="HTML">
<xsl:template match="/">
<HTML>
<HEAD>
<TITLE>Account</TITLE>
<META NAME="description" CONTENT="Member Account"/>
<META NAME="keywords" CONTENT="Account"/>
<META NAME="Author" CONTENT="Sunker"/>
<META NAME="generator" CONTENT="XHTML 5.00.2314.1000"/>
<META HTTP-EQUIV="no-cache"/>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"/>
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript"/>
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"/>
<META HTTP-EQUIV="Window-target" CONTENT="main"/>
</HEAD>
<BODY>
<xsl:apply-templates select="TRADING/Roots/Pale"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="TRADING/Roots/Pale">
<DIV STYLE="COLOR:BLUE;FONT-WEIGHT:BOLD">
<xsl:eval>childNumber(this)</xsl:eval>-<Span><xsl:value-of select="."/></Span>
</DIV>
</xsl:template>
</xsl:stylesheet>
=======================================
ASP FILENAME = TEST.ASP
<%@ Language=JScript %>
<%Response.ContentType="text/xml"
msg = '<Roots>'
for (var i=0;i<100;i++){
msg+='<Pale>Pxc'+i+'</Pale>';
}
msg+='</Roots>';
Response.Write (msg);
%>
thanks
Sunker
(this's xml page generate by GENXMLTOHTML http://www.geocities.com/researchtriangle/campus/7211)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3484 bytes
Desc: not available
Url : http://mailman.ic.ac.uk/pipermail/xml-dev/attachments/19991209/d87ac12d/winmail.bin
More information about the Xml-dev
mailing list