472,983 Members | 2,488 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to value-of in copy-of document to merge ?

SIMPLY VERSION OF THE QUESTION:
XML_TO_COPY.XML
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="xsl_that_copies.xsl"?>
<fruits date="20060621">
<fruit name="orange" />
</fruits>

COPY_RESULT_THAT_IS_INTENDED.XML
orange

XSL_THAT_TRIES_TO_COPY_BUT_DOES_NOT_WORK.XSL
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:template match="/">
<!-- ?!: this or something similar -->
<xsl:copy-of select="document('20060618.xml')/fruits/fruit[value-of
select='@name']" />
</xsl:template>
</xsl:stylesheet>

CRYPTIC VERSION OF THE QUESTION:
I have such xml files stored by dates. On user input for a date range,
I intend to merge that many xml files and output their fruit names.

Thanks in advance.

Jun 21 '06 #1
1 1029
vo*******@spatiallink.org wrote:
CRYPTIC VERSION OF THE QUESTION:
I have such xml files stored by dates. On user input for a date range,
I intend to merge that many xml files and output their fruit names.


Your simplified example doesn't match your question, unfortunately. But
some components:

1) User input: That's typically either stylesheet parameters given at
time of execution, or an index file which is presented to the stylesheet
as input. Pick one, determine its syntax, and figure out how you're
going to retrieve/generate the names of the files from that data.

2) You'll then have to for-each over the files. Note that you're likely
to wind up with all the files in memory simultaneously; if they're big,
this may not be tenable and you may want to separate the tasks of
extracting and merging the data. (Some XSLT processors have hooks
specifically to help you manage this kind of
scripting-across-multiple-files problem; Xalan does, for example.
Useful, but unfortunately nonportable.)

3) To get the value(s) from each document, you want something like
<xsl:value-of select="document($filename)/fruits/fruit/@name"/>
or, if you want to check the date within the file
<xsl:value-of
select="document(whatever)/fruits[@date=$datevalue]/fruit/@name"/>

That should be enough to get you started.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Jun 21 '06 #2

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

Similar topics

8
by: AC | last post by:
I hope someone can tell me why this is not working. I have a form that dynamically creates the code below. This is for one product and there are about 10 to 50 products that are listed depending...
4
by: gimme_this_gimme_that | last post by:
Hi, I Oracle one can have : select to_char(a_id_seq.nextval,'0000') from dual Which fetches a sequence value and pads it with zeros on the left. When the sequence value is more than 4...
5
by: drdave | last post by:
Hi, I have 6 forms being generated using coldFusion, they are named special1, special2 special3 and so on.. in these forms I have a link to open a new window. I am trying to pickup the...
2
by: Ryan Liu | last post by:
Hi, What is the best practise to sove this problem: property with defalut value will not be called in auto-generated code ? for example
2
by: Pugi! | last post by:
hi, I am using this code for checking wether a value (form input) is an integer and wether it is smaller than a given maximum and greater then a given minimum value: function...
12
by: Doogie | last post by:
How do I make a value the default value for a combo box in ASP 3.0? What I have below does NOT work, yet I've seen it in HTML file examples before (and works if I put it in a HTML file by itself,...
1
by: nudayasankar | last post by:
Hi all, I need to convert an XML using XSLT transformation. I want to call a template (with-param) in a loop. Intially I can call it with a default value. That template returns a value which should...
3
by: whitey | last post by:
this code is producing the message BUT it is entering the data. What should i do? <?php if (!$_POST) { //haven't seen the form, so show it $display_block = " <form...
13
by: Josip | last post by:
I'm trying to limit a value stored by object (either int or float): class Limited(object): def __init__(self, value, min, max): self.min, self.max = min, max self.n = value def...
6
by: Ahmedhussain | last post by:
Hi there, I m doing work on a gridview and Im getting an error: A potentially dangerous Request.Form value was detected from the client (ctl00$Content$GridView1$ctl03$TextBox1="<span...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.