473,507 Members | 6,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

use xsl:element to output an "<xsl:template match=...> ?

hi, trying to use an xslt to make an xslt. trying something like:

<?xml version="1.0" encoding="UTF-8"?>
<?xmlspysamplexml H:\java\projects\spy1\spy\inputDocumentMap.xml?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/inputDocumentMap">
<xsl:element name="xsl:template" match="/inputDocument">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

but this is not going very well (the files are at:
http://tayek.com/~ray/spy1/

i want to create the sampleT1.xslt file (which will eat
inputDocument.xml) from inputDocumentMap.xml. the sampleT1 works fine
(at least in java, but xmlspy produces garbage). i want to create this
file programmatically.

i would assume that this (creating an xslt from an xslt and an xml)
*can* be done but maybe it would be better to do it in java as i am a
newbie to xslt (it's my first functional langauge). i have done this
with a previous incarnation of the sampleT1.xslt, so it's not a problem,
but it would be cool to do it in xslt.

any pointers would be apreciated.

thanks
---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/
Jul 20 '05 #1
3 3195
Ray Tayek wrote:
hi, trying to use an xslt to make an xslt. trying something like:

...
<xsl:template match="/inputDocumentMap">
<xsl:element name="xsl:template" match="/inputDocument">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>


this may be working a bit better:

<?xml version="1.0" encoding="UTF-8"?>
<?xmlspysamplexml H:\java\projects\spy1\spy\inputDocumentMap.xml?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/inputDocumentMap">
<xsl:element name="xsl:template">
<xsl:attribute name="match">/inputDocumentt</xsl:attribute>
<!--xsl:attribute name="xml:space">preserve</xsl:attribute>-->
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/
Jul 20 '05 #2
Read also about the
xsl:namespace-alias
instruction.

Using it to produce an xsl:stylesheet as the result of the transformation is
more convenient than using xsl:element.

Of course, it is also recommended to try another solution that solves your
problem directly, without having to produce an intermediate stylesheet.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

"Ray Tayek" <rt*******@spam.comcast.net> wrote in message
news:sXhyb.260314$9E1.1380781@attbi_s52...
Ray Tayek wrote:
hi, trying to use an xslt to make an xslt. trying something like:

...
<xsl:template match="/inputDocumentMap">
<xsl:element name="xsl:template" match="/inputDocument">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>

this may be working a bit better:

<?xml version="1.0" encoding="UTF-8"?>
<?xmlspysamplexml H:\java\projects\spy1\spy\inputDocumentMap.xml?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/inputDocumentMap">
<xsl:element name="xsl:template">
<xsl:attribute name="match">/inputDocumentt</xsl:attribute>
<!--xsl:attribute name="xml:space">preserve</xsl:attribute>-->
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting

work vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/

Jul 20 '05 #3
Dimitre Novatchev wrote:
Read also about the xsl:namespace-alias instruction.
ok
Using it to produce an xsl:stylesheet as the result of the transformation is
more convenient than using xsl:element.

Of course, it is also recommended to try another solution that solves your
problem directly, without having to produce an intermediate stylesheet.

that is a great idea, but i ahev no clue how to do it.

i have a sample of the desired type of xslt that i want to produce
called sampleT1.xsl at http://tayek.com/~ray/spy1/. it transforms the
inputDocument.xml into what is needed. (the problem is to consume .csv's
from excel that have notes with line breaks and ' and " and space
charaters in the field names, so i have a csvparser that makes
inputDocument.xml from the lusers' .csv).

another input is the inputDocumentMap.xml which describes the processing
that needs to be done on the inputDocument.xml file (this involves
renaming fields, deleting fields, mapping data values of fields, and
outputting records based on trigger fields in the input records).

the idea is to let the user define the processing to be done on his csv
file to get it into our xml/csv format, so this is done by a web app and
i will get an inputDocumentMap.xml from this user interaction and then
he can upload his .csv's so we can process them and stick 'em in our system.

thanks

"Ray Tayek" <rt*******@spam.comcast.net> wrote in message
news:sXhyb.260314$9E1.1380781@attbi_s52...
Ray Tayek wrote:
hi, trying to use an xslt to make an xslt. trying something like:
....

this may be working a bit better:

<?xml version="1.0" encoding="UTF-8"?>
<?xmlspysamplexml H:\java\projects\spy1\spy\inputDocumentMap.xml?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/inputDocumentMap">
<xsl:element name="xsl:template">
<xsl:attribute name="match">/inputDocumentt</xsl:attribute>
<!--xsl:attribute name="xml:space">preserve</xsl:attribute>-->
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

---
ray tayek http://tayek.com/ actively seeking mentoring or telecommuting work
vice chair orange county java users group http://www.ocjug.org/
hate spam? http://samspade.org/ssw/
Jul 20 '05 #4

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

Similar topics

1
15065
by: Matt | last post by:
For example, how to represent hyperlink in XSL? I want to add hyperlink in XSL. i.e. I need to generate <A HREF="http://mypage.html">home page</A> in HTML. I tried the following approaches but...
1
1411
by: Vijay singh | last post by:
Hi wonder if anybody can clear by doubt XML file : <score id="1"> <film>A Little Princess</film> <composer>Patrick Doyle</composer>
7
2076
by: Diandian Zhang | last post by:
Does anyone have an idea, how to do it? Thanks in advance!
7
2036
by: KJ | last post by:
What does this do: <xsl:apply-templates select="." /> ?
4
1803
by: dwa | last post by:
Is it legal to use a parameter in a <template match> ? If I do the following: <xsl:template match="/ContentRoot/Content/Categories/Category"> ....everything works as expected. But if I...
3
3122
by: Blaise Garant | last post by:
Hi I've made a stylesheet to transform my data into XSL-FO. This stylesheet used to work with MSXSL 4.0 but I've got some issues in ..NET. First, I changed removed all the "node-set()" function...
3
1939
by: b0yce | last post by:
Hi Group, I think I have found a problem with the <xsl:element> when being transformed by the .NET xmlTransform class. When using XmlSpy for development and debugging, the <xsl:number>...
2
1802
by: Paul Verbelen | last post by:
I have a file with topics. I like to copy them in another file but want to have some blank lines between the different topics. I use <xsl:text> element with as data some blank lines to perform...
4
9147
by: Jon | last post by:
Hi, I used XslCompiledTransform with the following Xsl file. The <xsl:text disable-output-escaping="yes"does not work when using XslCompiledTransform to do the trnasform (namely the output...
0
7220
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
7308
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
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.