OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XSLT with DOM

[ Lists Home | Date Index | Thread Index ]
  • From: sunker@telkom.net
  • To: "'xml-mailinglist'" <xml-dev@ic.ac.uk>
  • Date: Thu, 9 Dec 1999 10:39:54 +0800

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)

winmail.dat





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS