all groups > sql server (alternate) > march 2004 >
You're in the

sql server (alternate)

group:

Inculde XML genrated by server (re-posted to sever group)



Inculde XML genrated by server (re-posted to sever group) KemperR NO[at]SPAM ee.nec.de
3/19/2004 2:54:03 PM
sql server (alternate): Dear Experts,

I have posted this to a more xml oriented group, but there was no
answer so-fr. Maybe just because of the fact that sql server is
involved. So here I try it the other way around

Please have a look to the following. I'm trying to include results
from server ( SQL2000 )created by a call like below. I expect that the
href is resolved before the results are processed by xslt. But this
does not work.

(Meatime I have also tried to use a template and change the URL to
http://intra.etc.nec.de/neo/test.xml where test.xml holds the qery.
But the result is the same as below described in my privious mail)


http://intra.etc.nec.de/neo?sql=SELECT+*+FROM+Designs+FOR+XML+AUTO&root=MyRoot

This works fine and IE6 displays the recieved xml as expected:

<?xml version="1.0" encoding="utf-8" ?>
- <MyRoot>
<Designs DesignName="D47678" PelletClasses_ID="7" OPCVersions_ID="7"
SimApproach="" SignOffApproach="" Comment=""
XChipSizeBP="8.8499999999999996" YChipSizeBP="9.0600000000000005"
XChipSizeFinal="9.4800000000000004"
YChipSizeFinal="9.0600000000000005" Designs_ID="1" />
<Designs DesignName="D90767" PelletClasses_ID="7" OPCVersions_ID="7"
SimApproach="" SignOffApproach="" Comment="" XChipSizeBP="6.96"
YChipSizeBP="7.1699999999999999" XChipSizeFinal="6.54"
YChipSizeFinal="6.96" Designs_ID="2" /> ...........


Next I tried to include this into an xml file.
OK, I had to delete the root parameter in the call because the xml
href could not stand the equal sign ( ..&root=MyRoot ).
Does anybody know how I can keep this in the href ?
However, the information is returned without the MyRoot top element.

So my final xml looks like this:


<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="H:\tmp\XML\Include.xslt"?>
<DesignsI DI="DesignInclude">
<xi:include href="http://intra.etc.nec.de/neo?sql=SELECT+*+FROM+Designs+FOR+XML+AUTO"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
</DesignsI>


To process that I made I tiny XSLT as shown below

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso8859-1"/>
<xsl:template match="/*">
<html>
<body>
<h1><u> Designs </u></h1>
<h2><xsl:value-of select="@DI"/></h2>
<h2><xsl:value-of select="//@DesignName"/></h2>
<h2>Done</h2>
</body>
</html>
</xsl:template>
</xsl:stylesheet>


The result on browser is as expected except that the content derived
by server is missing.

Designs
DesignInclude
<== expected some DesignName here
Done

Any idea what I'm doing wrong ?

Thanks a lot
Re: Inculde XML genrated by server (re-posted to sever group) news.la.sbcglobal.net
3/19/2004 11:53:10 PM
There are five special characters in XML that need to be replace by a text
equivalent:

& = &amp;
' = &apos;
" = &quot;
< = &gt;
[quoted text, click to view]

Will this help you?

--Brent

[quoted text, click to view]

AddThis Social Bookmark Button