473,320 Members | 2,035 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,320 software developers and data experts.

Transformer problem - attributes position changing

Hi,
Have an XML file with this element
<File Name="" Description="" CreatedBy="" CreatedDate="" LastModifiedBy="" ModifiedDate="">

i converted DOm to string using :

TransformerFactory transformerFactory = TransformerFactory
.newInstance();
Transformer transformer = transformerFactory.newTransformer();
StringWriter sw = new StringWriter();
transformer.transform(new DOMSource(doc), new StreamResult(sw));
String stringDOM = sw.toString();

It sorts the attributes in alphabetical order. now the element looks like
<File CreatedBy="" CreatedDate="" Description="" LastModifiedBy="" ModifiedDate="" Name="">

I need to maintain the order. How can i do that? Is there any way to do so?

I am using xalan.jar.

Thanks in advance,
Subhash.
Oct 26 '07 #1
0 1154

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Russ | last post by:
Suppose I want to specify a position on the earth. I could define an element such as <position coords="WGS84", lat="34.56223", lon="-121.8277"/> where lat and lon are latitude and longitude in...
2
by: Angus Parvis | last post by:
Hi, I've already posted this in comp.lang.java.programmer, but it doesn't seem like the ppl there can help. I hope you guys here know more about it, altough my question is more java than xml...
25
by: Haines Brown | last post by:
I have a table with three columns, and I want the data in the first column to align left, while that in the remaining columns to align right: #testTable { text-align: right; } #leftcol {...
2
by: Martijn | last post by:
Because XSD (XML Schema Document) is a definition of the XML document, there must be a parser that can read a XSD file and give the complete XML file as a result. Is there something like this,...
0
by: Christian | last post by:
Hi, I try to change the position of a WebUserControl on my WEbform (layout is set to GridLayout) by changing the absolute position in the html-code but it does not work. When I change the...
1
by: Bruce | last post by:
I use btnSave.Attributes.Add("onclick", "ShowMessage()") to link my web control button to a JavaScript function. It works well until I added a Validation control into the page. After that,...
2
by: Sam Malone | last post by:
I have these four methods to change the position in a table. However when I invoke any of them nothing appears to happen to the table. It doesn't scroll. The selector pointer doesn't move. Nada!! If...
2
by: venkatbo | last post by:
Hi all, I have python2.4 running on ppc-linux 2.6.17. I'm attempting to get a TurboGears 0.9a9 (using CherryPy 2.2.1) based app running on it. During the TG-app startup sequence, it reaches...
1
by: killy971 | last post by:
I am using the following syntax, with Xalan, to process xml transformations in java: StreamSource xml = new StreamSource(xmlFile); StreamSource xsl = new StreamSource(xslFile); StreamResult out...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.