473,378 Members | 1,555 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,378 software developers and data experts.

Generating XML fragment to DOM node using XSL

Hi All:

I am attempting to use an XSL stylesheet to take data from an existing
DOM document, and place it into a different existing DOM document.

The problem I'm having is that I get the following exception from
Xalan-J (version 2.5.2), because I am not generating a single root
node from my stylesheet:

"Can't have more than one root on a DOM!"

Now I understand that I can't create more than one root node on a DOM
document, but since I'm generating these nodes into an already
existing document, I assumed that this would not be an issue. I can
generate a single rot node as part of my transform, and all works
fine, but the resulting data as placed into my destination document is
screwed due to the addition of a new node.

Is there some switch setting or something that I need to use to make
this work? I'm fervently hoping that this is not something that "just
can't be done using XSLT", and that I've just missed something in the
docs...

Any help greatly appreciated...

Thanx,
Steve Dussinger
Jul 20 '05 #1
3 2104
If you're interested in a JDOM solution, let me know.

There's no point of my cooking up a solution if it is of no interest to you.
Jul 20 '05 #2
gi*******************@yahoo.com (GIMME) wrote in message news:<3f**************************@posting.google. com>...
If you're interested in a JDOM solution, let me know.

There's no point of my cooking up a solution if it is of no interest to you.


Thanx for the interest, but I *really* need to be able to do this with XSLT...

Thanx anyway.

--Steve
Jul 20 '05 #3
I'm puzzled by what you mean when you say you need use XSLT.

Do you mean that you need a command line solution and that
you can't write a JAVA program to do the work?

XSLT transforms are easy with JDOM.

With JDOM you can go back and forth between JDOM
Documents and W3C Documents with one method call.

Go to http://www.jdom.org/docs/apidocs/index.html and look
at DOMBuilder and DOMOutputter. Look at JDOMResult if you
want to see how to do a transform.

If you want an example where I :

1. read an xslt file,
2. read an xml
3. read an xml
4. Do a transform on one and two.
5. Combine the result with 3.
6. Return a single org.w3c.dom.Document

let me know. That's what you wanted. Right?
sd******@tampabay.rr.com (Steve Dussinger) wrote in message news:<c0**************************@posting.google. com>...
gi*******************@yahoo.com (GIMME) wrote in message news:<3f**************************@posting.google. com>...
If you're interested in a JDOM solution, let me know.

There's no point of my cooking up a solution if it is of no interest to you.


Thanx for the interest, but I *really* need to be able to do this with XSLT...

Thanx anyway.

--Steve

Jul 20 '05 #4

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

Similar topics

17
by: flupke | last post by:
Hi, i create my GUIs mainly via wxGlade. However when you start of to program and want to do some rearranging to the gui, wxglade overwrites your file and you've got to put your own code back...
1
by: QuantDev | last post by:
Hi NG, I would need to validate an XML fragment against a type defined within an XSD (which defines many other things). What is the correct way of achieving this? QD2004
2
by: Rick Strahl [MVP] | last post by:
Hi all, I need a reality check <g>... I have the following XML fragment: <event sitename="West Wind Demo Link"> <url>http://rasnotebook/wconnect/testpage.wwd?Test2</url> <time>11/17/2003...
2
by: Joe Gass | last post by:
Hi I have a query that uses for xml auto I'd like to load this into an xmldocument with an xmlreader e.g. Dim xr As XmlReader xmlDoc = New XmlDocument xr = oCom.ExecuteXmlReader If xr.Read...
1
by: Wallace | last post by:
Hi all, I have a problem on validating a xml fragment using a single namespace schema which spread across multiple schema files using include in the master schema file. No matter how I change...
1
by: Rajarshi | last post by:
Hi, I'm using ElementTree for some RSS processing. The point where I face a problem is that within an <item></itemI need to add another child node (in addition to <linketc) which is a well-formed...
7
by: Jan Eliasen | last post by:
Hi I have some C# code that loops through an XMLDocument and needs to apply an XSLT stylesheet to each node in the XML document. My (simplified) code looks like this: XmlDocument xmldoc = new...
2
by: Shimon Sim | last post by:
Hi I keep getting error : WriteStartDocument cannot be called on writers created with ConformanceLevel.Fragment. The code that I have is very simple. SimpleClass c = new SimpleClass();
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.