473,388 Members | 944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Can I pass a querystring to an XML SYSTEM uri?

I'm using an xsl stylesheet to transform an xml source from a remote
URL. I'm using the xslt.pl processor available from
"http://www.dopscripts.com/doc/description.html". The remote URL is
placed in the prologue/prolog (US English spellings have never come
naturally to me) of the xsl document as follows:

<?xml version="1.0"?>
<!DOCTYPE my-news [<!ENTITY news SYSTEM "http://path.to/xmlfile.xml">]>
<xsl:stylesheet version="1.0">
<xsl:variable name="news">&news;</xsl:variable>
<xsl:template match="/">
<xsl:for-each select="$news">

etc

</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Now say the url of the XML source is
"http://path.to/xmlfile.xml?id=*id*" where *id* is a querystring
parameter, is there any way of passing this value to the SYSTEM uri?

I know there are methods of passing external parameters into xsl, but as
this question is about what happens before the xsl begins this is more
of a general xml question than a specific xsl question

Aug 4 '05 #1
6 2615
nope.

DTDs have no knowledge of querystrings, therefore you cannot refer to a
querystring from a DTD. Could be chaotic if you could. Of course the
location for your dtd can be a relative uri.

So either you would have to alter the xml programmatically before
sending it onward to put in the right value, or set it up in such a way
that you do not need to do this.

Aug 6 '05 #2
In article <11**********************@g49g2000cwa.googlegroups .com>,
pantagruel <br*@itnisk.com> wrote:
DTDs have no knowledge of querystrings, therefore you cannot refer to a
querystring from a DTD.


DTDs have no knowledge of querystrings, so they have no way of
preventing you from using one. You can perfectly well have

<!DOCTYPE foo SYSTEM "http://example.org/my.cgi?whatever">

or something similar for an entity declaration, and quite likely for
the URI you pass to your XML processor in the first place.

What you can't do of course is control *what* query is used in a
SYSTEM id, except by changing the file itself.

Fragment identifiers are quite another matter, and are prohibited
in system ids.

-- Richard
Aug 6 '05 #3
My impression was that he wanted to do

" http://path.to/xmlfile.xml?id= *id*"" where when he said id was a
querystring parameter he meant that id was a querystring parameter
being passed in the querystring for his application.

as in
http://mysite.com/application?id=howdy
then his dtd will resolve to
"http://path.to/xmlfile.xml?id=howdy"

this was what I was trying to convey by saying 'refer to a querystring'
as opposed to 'writing a querystring'.

Aug 7 '05 #4
Thanks chaps

You've both answered my question - no need to argue :)

I wanted to know if there was something I could use in that context which
was analogous to asp.net's Request.QueryString["id"]. Obviously I can't,
I'll see what I can do in the perl layer

Cheers

John
Aug 8 '05 #5
John Wilkin wrote:
Thanks chaps

You've both answered my question - no need to argue :)

I wanted to know if there was something I could use in that context which
was analogous to asp.net's Request.QueryString["id"]. Obviously I can't,
I'll see what I can do in the perl layer

Cheers

John


hi,

i'm sure you'll find something usefull with the XSLT's document() function :

try this :

<?xml version="1.0"?>
<xsl:stylesheet version="1.0">
<xsl:param name="id"/>
<xsl:variable name="news"
select="document(concat('http://path.to/xmlfile.xml?id=', $id)"/>
<xsl:template match="/">
<xsl:for-each select="$news">
--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------
Aug 8 '05 #6


Philippe Poulard wrote:
hi,

i'm sure you'll find something usefull with the XSLT's document() function :

try this :

<?xml version="1.0"?>
<xsl:stylesheet version="1.0">
<xsl:param name="id"/>
<xsl:variable name="news"
select="document(concat('http://path.to/xmlfile.xml?id=', $id)"/>
<xsl:template match="/">
<xsl:for-each select="$news">
--
Cordialement,

///
(. .)
-----ooO--(_)--Ooo-----
| Philippe Poulard |
-----------------------


Thanks for the tip, I didn't know about the document() function. Unfortunately
the xsltp.pl processor doesn't seem to either, but this could come in very
useful if I try to do anything similar using client side transformations.

One day all browsers will support xslt and life will be much easier

Merci beaucoup

John
Aug 9 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
How to pass data back and forth between ASP and JSP page? Let's say I have Java objects, how to pass the data back to ASP page?? Or ASP has data, how to pass the data to JSP page?? Please...
1
by: DC Gringo | last post by:
I am trying to pass an input parater to SQL Server. The parameter is a URL querystring variable. I can't seem to get it to pass a variable, only a literal value... Help! In the following...
1
by: DC Gringo | last post by:
I am trying to pass an input parater to SQL Server. The parameter is a URL querystring variable. I can't seem to get it to pass a variable, only a literal value... Help! In the following...
3
by: Naseem | last post by:
I am using CR in ASP.NET , I am able to show drill down graphs where grouping is done on single column from result set of sql query, is it possible to achieve drill down by grouping on multiple...
3
by: Sharon | last post by:
hello all, I was successfull in passing one value from first webpage to second webpage, but not sure how to pass three textbox values from the first page to the second page. Below is the code i...
2
by: bbsbob | last post by:
Hello, I'm still using the Framework v1.1. Forgive me, I'm working on a legacy application. I'm using 2 iFrame sections with 2 aspx pages, i.e. 1.aspx (left) and 2.aspx (right) In 1.appx page,...
0
by: dakota64 | last post by:
Greetings all, I have a gridview that I need to pass the primary key from a selected row to a new page. I have it working with a querystring, but I would like to do it without using the...
1
by: =?Utf-8?B?ZG90TmV0RGF2ZQ==?= | last post by:
I think you can actually get this from the Request object. It might be in the ServerVariables collection. David -- ====================================== David McCarter www.dotNetTips.com...
2
by: =?Utf-8?B?U3RldmVuIFRhbmc=?= | last post by:
I'm creating a XBAP application and want it take some input from webpage dynamically? what is the best way? how to do it? Best Regards Steven -- ======================= Steven Tang SYWWUYU)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.