Ask a Question related to ASP Database, Design and Development.
-
rpjoseph #1
XML Filter
I am trying to use XML and XSL together with ASP. I have
the following ASP:
set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = false
xml.load(Server.MapPath("articleIndex.xml"))
set xsl = Server.CreateObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load(Server.MapPath("xslTest.xsl"))
Response.Write(xml.transformNode(xml))
And the following XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:for-each select="articles/article">
<xsl:sort select="@newsDateSort" order="descending" />
<p>
<a>
<xsl:attribute name="href">
<xsl:value-of select="@prPath" />
</xsl:attribute>
<xsl:value-of select="@newsDate" /> - <xsl:value-
of select="headline" />
</a>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I want to filter the XML - such as - "articles/article
[@component='someValue']" before calling or within the XSL
file. I have tried using many different methods but
nothing seems to work. I now that this must be easy.
What is the best way to do this?
Thank you
rpjoseph Guest
-
about filter
hello, In PDF file,<</Length 120/Filter/FlateDecode/I 144/L 128/S 40/V 106>> ,what does "I,L,V" mean? what the different between "<</Length... -
#40499 [NEW]: filter sapi does not register any highlightning filter
From: php at henke37 dot cjb dot net Operating system: any PHP version: 6CVS-2007-02-15 (CVS) PHP Bug Type: Apache2 related... -
Data Grid Header Filter Renderer or how do I get aheader to filter the data in a datagrid.
Okay so on the same theme as why isn't the datagrid like Excel, I have created a (very cool) Filter header. 1) The filter looks like any other... -
CSS Filter
I can't seem to get my alpha filter to render in firefox, but it does fine in IE. Anyone know what's up with this, i've been working with CSS for a... -
Filter
hello sir, i have a form which has a subform1 and the subform1 has subform2 i am able to filter main form for a particular number of feilds... -
XML Filter
I forgot an important part of this. I need the filter to
be dynamic based on Request.QueryString. So I either need
to filter the XML before transformation or pass a variable
to XSL to be used as <xsl:param..>
>-----Original Message-----
>I am trying to use XML and XSL together with ASP. I have
>the following ASP:
>
> set xml = Server.CreateObject("Microsoft.XMLDOM")
> xml.async = false
> xml.load(Server.MapPath("articleIndex.xml"))
>
> set xsl = Server.CreateObject("Microsoft.XMLDOM")
> xsl.async = false
> xsl.load(Server.MapPath("xslTest.xsl"))
>
> Response.Write(xml.transformNode(xml))
>
>And the following XSL:
>
><?xml version="1.0"?>
><xsl:stylesheet version="1.0"
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
><xsl:template match="/">
><html>
><body>
><xsl:for-each select="articles/article">
><xsl:sort select="@newsDateSort" order="descending" />
>
> <p>
> <a>
> <xsl:attribute name="href">
> <xsl:value-of select="@prPath" />
> </xsl:attribute>
>
> <xsl:value-of select="@newsDate" /> - <xsl:value-
>of select="headline" />XSL> </a>
> </p>
> </xsl:for-each>
> </body>
> </html>
></xsl:template>
></xsl:stylesheet>
>
>I want to filter the XML - such as - "articles/article
>[@component='someValue']" before calling or within the>file. I have tried using many different methods but
>nothing seems to work. I now that this must be easy.
>
>What is the best way to do this?
>
>Thank you
>.
>Guest
-
Chris Hohmann #3
Re: XML Filter
<anonymous@discussions.microsoft.com> wrote in message
news:01d601c3a49c$2a42cc20$a401280a@phx.gbl...If you were pulling the data from a db, I would recommend you filter the> I forgot an important part of this. I need the filter to
> be dynamic based on Request.QueryString. So I either need
> to filter the XML before transformation or pass a variable
> to XSL to be used as <xsl:param..>
>>> >-----Original Message-----
> >I am trying to use XML and XSL together with ASP. I have
> >the following ASP:
> >
> > set xml = Server.CreateObject("Microsoft.XMLDOM")
> > xml.async = false
> > xml.load(Server.MapPath("articleIndex.xml"))
> >
> > set xsl = Server.CreateObject("Microsoft.XMLDOM")
> > xsl.async = false
> > xsl.load(Server.MapPath("xslTest.xsl"))
> >
> > Response.Write(xml.transformNode(xml))
> >
> >And the following XSL:
> >
> ><?xml version="1.0"?>
> ><xsl:stylesheet version="1.0"
> >xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> ><xsl:template match="/">
> ><html>
> ><body>
> ><xsl:for-each select="articles/article">
> ><xsl:sort select="@newsDateSort" order="descending" />
> >
> > <p>
> > <a>
> > <xsl:attribute name="href">
> > <xsl:value-of select="@prPath" />
> > </xsl:attribute>
> >
> > <xsl:value-of select="@newsDate" /> - <xsl:value-
> >of select="headline" />> XSL> > </a>
> > </p>
> > </xsl:for-each>
> > </body>
> > </html>
> ></xsl:template>
> ></xsl:stylesheet>
> >
> >I want to filter the XML - such as - "articles/article
> >[@component='someValue']" before calling or within the> >file. I have tried using many different methods but
> >nothing seems to work. I now that this must be easy.
> >
> >What is the best way to do this?
> >
> >Thank you
data there. But since the xml is a flat file, you will need to pass a
parameter into the stylesheet (xsl). Here's the documentation for
addParameter method of the DOMDocument object. The example is pretty
self explanatory. In the future, please indicate which version of
IIS/ASP you are running. Also,when dealing with XML/DOM please indicate
which version of MSXML you are using.
[url]http://msdn.microsoft.com/library/en-us/xmlsdk/htm/xml_mth_ac_5pgy.asp[/url]
HTH
-Chris
Chris Hohmann Guest



Reply With Quote

