Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa XML Sorting Xml file

Have Programming Question? Ask it here!
 
 
 


PontLay
Sorting Xml file
2 Answer(s)      5 years and 8 months ago
Posted in : XML



Advertisement
View Answers

December 7, 2008 at 12:49 AM


I am trying to do it with xslt. But it can't sort my xml file. Here is my xslt.

<xsl:template match="entry">
<xsl:for-each select="kw">
<xsl:sort select="kw" order="ascending"/>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>

And the output is like this:
Smith
USA
Bob
USA
John
UK
Smith
SG
Amy
AUC

I don't know where is wrong. And how can I do it to show within <rec> <name> and <loc> tag.
Thanks.


December 7, 2008 at 12:49 AM


I am trying to do it with xslt. But it can't sort my xml file. Here is my xslt.

<xsl:template match="entry">
<xsl:for-each select="kw">
<xsl:sort select="kw" order="ascending"/>
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>

And the output is like this:
Smith
USA
Bob
USA
John
UK
Smith
SG
Amy
AUC

I don't know where is wrong. And how can I do it to show within <rec> <name> and <loc> tag.
Thanks.


Related Tutorials/Questions & Answers:
Sorting Xml file - XML
Sorting Xml file  I have an xml file like this: Smith USA... sort my xml file. Here is my xslt..., my ouput file will be like this: Amy AUC Bob USA John UK
Sorting text file
Sorting text file  Hello friends, i'm writing search page for my local website. i'm storing all file list in text file. And also adding a value to each line at the beginning. now i want to sort file content in descending order
Advertisements
Creating XMl file - XML
Creating XMl file   I went on this page: http://www.roseindia.net/xml/dom/createblankdomdocument.shtml and it shows me how to create an XML file, however there is something I don't understand. I have to create an XML file
sorting and filtering the displayed table data using jsp and xml
sorting and filtering the displayed table data using jsp and xml  I have created a xml file and a jsp file, which uses DOM parser to display the content of xml file in web page. Now I would like to sort and filter those data
xml file display - XML
xml file display   - - - - ADL SCORM CAM 1.3 - - session3 - Online Instructional Strategies that Affect Learner... code to display the above xml file in tree structure where
sorting
sorting   write a program to arrange sorting in rows,column and diagonal
Sorting
Sorting  can any help me know which sorting algorithm java uses for sorting collection and arrays
sorting
sorting  write to a program to arrange the sorting in rows, column and digonal
sorting
sorting  how to do sorting without using bubble sort,selection sort
splitting large xml file. - XML
splitting large xml file.  Hi, I have a large xml file(1G) and a schema (XSD) i need to split this xml to small xml files (~20M) that will be valid by the schema
parsing xml file in jsp
parsing xml file in jsp  example that pars XML file in JSP
executio of xml file
executio of xml file  how to execute xml file , on web browser
How to create XML file - XML
How to create XML file  Creating a XML file, need an example. Thanks!!  To create XML file you need plain text editor like note pad. After creating your file save it with .xml extension.  Hi,Java programming
how to read this xml file - XML
how to read this xml file  i want to read this xml file using java... read i have tried lot more , but i am not able to read this xml file...[])throws Exception { File f=new File("C:/data.xml"); DocumentBuilderFactory
Run XML file
Run XML file  Hi.. How do I execute or run an XML file? please tell me about that Thanks
xml file creation in java
xml file creation in java  how to create xml file in java so that input should not be given from keyboard. and that file should be stored.   Please visit the following links: http://www.roseindia.net/tutorial/java/xml
How to prepare XML file?
How to prepare XML file?  Hi, I want to prepare XML File, can you... you create an XML file.. Create XML File using Servlet How to generate build.xml file Complete Hibernate 3.0 and Hibernate 4 Tutorial Thanks
Read text file to 2D array and sorting the second column
Read text file to 2D array and sorting the second column  we found that the student names with marks in a text file the marks decreases significantly... their names in a text file
xml configuration file - JDBC
xml configuration file  Hi, Could you please tell me how to write a xml configuration file . We have mysql database in some other system. I have... to create a xml file. Please help me out. Thank you  Hi Friend, Try
retrieve in xml file in struts2
retrieve in xml file in struts2  i am using struts2 and trying... can i get back the value from the xml file in the ajax function and print... properties file using ajax. i now put the values from properties file to map
questions from an xml file
questions from an xml file  i am developing online bit by bit exam for that i retrieved questions from an xml file but when i retrieved using jsp i am getting all questions at a time in a single page.but i want to show one
how to convert .xml file to csv file
how to convert .xml file to csv file  how to convert .xml file to csv file
How to convert XML file to database ?
How to convert XML file to database ?  How to convert XML file to database
how to seach a keyword in a xml file - XML
how to seach a keyword in a xml file  i have a xml file. i wanted to read and store all the tag values. i have a html form in which when i enter some keyword say "a" then it has to display the tag values starting with a letter
Store XML file into Sqlserver Database
Store XML file into Sqlserver Database  Code for storing a typical XML file into SQl server database in 1 or more tables using asp.net using C
parsing XML file to get java object - XML
parsing XML file to get java object  Hello, I'm facing a problem in parsing XML file to get the java object. I've tried to retrieve data from XML file using SAX parser. my XML file structure is the following
How to write to xml file in Java?
How to write to xml file in Java?  Hi Friends, Can anyone help me how to write in xml file in Java programming. Please fill free to give example or reference website for getting example.   Hi, To write in xml file
How to create one xml file from existing xml file's body?
How to create one xml file from existing xml file's body?  Hi, i'm working with content optimization system.I want to know how we can take all data from an xml doc's body to develope another xml with that content.I'm using JDOm
Reading a xml file - JSP-Servlet
Reading a xml file  how to read a xml file using jsp and then i have to retrive a data from that file use it in code?  Hi Friend, Please visit the following link: http://www.roseindia.net/jsp/parsing-xml.shtml
Sorting in Java
Sorting in Java  Sorting in Java
how to convert text file to xml file in java. - XML
how to convert text file to xml file in java.  Hi all, I m having some problem. Problem is I want to convert a text file which is having the no of record(i.e no of different line of information)to a xml file through java
how to modify content of XML file
to xml file to replace "XYZ".Every time with the content of text box the file should...how to modify content of XML file  hi, I want to modify content of a xml file.There are two tags of similar name say <ContentName>C:\Myinfo
Reading a xml file - JSP-Servlet
Reading a xml file  Thanks for ur answer sir but problem is that i have to do a reading a xml file of a employee record and then i have to use a employee details to send mail to those employees how to do i sir please help me
SAX Parser for huge XML file
SAX Parser for huge XML file  Hi.... if the XML file is small...("Enter XML file name:"); String xmlFile = bf.readLine(); File file = new File...(); } } } .. What if the xml file is very big or huge file? and sometimes we wont
Java get XML File
Java get XML File     ... the XML file. For this, you need to create a XML file. Here is the employee.xml file: <?xml version="1.0"?> <company>
How read xml file value in dojox chart - XML
How read xml file value in dojox chart  How to read the xml file value in dojox chart
xml file reading using java
xml file reading using java  hi deepak I want to read some data from xml file and send that output to particular email address using java   import org.w3c.dom.*; import org.w3c.dom.Node; import javax.xml.parsers.
Writing xml file - Java Beginners
XmlServlet().createXmlTree(doc); System.out.println("Xml File Created...Writing xml file  Thank you for the quick response The values which... from xml tree StringWriter sw = new StringWriter
converting an xml file in relational database objects
converting an xml file in relational database objects  converting an xml file in relational database objects
parsing xml file using java code
parsing xml file using java code  parsing a xml file using java code
validation in struts2 using .xml file
validation in struts2 using .xml file  how to do xml validation in struts2 on dynamic fields   Hello Friend, Please visit the following link: http://www.roseindia.net/struts/struts2/struts2validation.shtml Thanks
parsing word xml file using SAX parser - XML
parsing word xml file using SAX parser  i am parsing word 2003's XML file using SAX.here my question is,i want to write some tag elements which... this xml file and write that xml part into file? can somebody
Store XML file into Sqlserver Database
Store XML file into Sqlserver Database  Code for storing a typical XML file into SQl server database in 1 or more tables using asp.net using C#. <?xml version="1.0" ?> <!DOCTYPE PubmedArticleSet (View Source
downloading created xml file - Java Beginners
need to create an xml file and when a button is clicked it has to prompt me for saving the xml file so i created xml file successfully and whats the problem is when i saved the file after prompting it is saved in .do format instead of xml
How to Split a large XML file using java?
How to Split a large XML file using java?  How can we split a 500MB Xml file?I know how to split xml file after reading the entire document in a file.Here we cannot load the entire file as it is a large file
Storing properties in XML file
Storing properties in XML file     ... File. JAXP (Java API for XML Processing) is an interface which provides parsing... in xml file:- File f=new File("2.xml"):-Creating File in which properties
graph generation from xml design file
graph generation from xml design file  how to search words in XML file with javascript. i have copied contents of XML file into word file. using searched keywords i would like to draw graph
group by sorting
group by sorting  group by sorting of data in SQL
How to build .XML file, please provide an example.
How to build .XML file, please provide an example.  Hello, I want to know how to build .XML file. If you can provide an example, that would be great... Thanks
data insertion from xml file to database table
data insertion from xml file to database table  Hi all, I have data in the XML file. I need to insert it into table in the database using servlet. so please reply me . ThankYou
Advertisements
 

 

 

DMCA.com