|
Hello.
I've a problem to sort a XML file into another xml file.
Here's the content of my XML File:
File: Drive.xml
<code>
<drive name="C" type="Local Disk" filesystem="NTFS" capacitygb="232" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<folder name="Depends" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Depends" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<file name="Profile.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Depends/Profile.xml" type="File" typefile="XML" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="Identity.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Depends/Identity.xml" type="File" typefile="XML" sizebytes="1284" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
</folder>
<file name="Meteo.pdf" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Meteo.pdf" type="File" typefile="PDF" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="Documents and Settings" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Documents and Settings" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="etc" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/etc" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="Program Files" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Program Files" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<file name="Identity.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Program Files/Identity.xml" type="File" typefile="XML" sizebytes="1284" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
</folder>
<folder name="Zouzou" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<file name="Profile.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou/Profile.xml" type="File" typefile="XML" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="Identity.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou/Identity.xml" type="File" typefile="XML" sizebytes="1284" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="Report.doc" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou/Report.doc" type="File" typefile="DOC" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
</folder>
<folder name="Windows" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Windows" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="LastCoroner.avi" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/LastCoroner.avi" type="File" typefile="AVI" sizebytes="1231254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="Inetpub" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Inetpub" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
</drive>
</code>
I want to sort it to have the following file : SortedDrive.xml which is sort first by the <file> and after by the <folder>
<code>
<drive name="C" type="Local Disk" filesystem="NTFS" capacitygb="232" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<file name="LastCoroner.avi" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/LastCoroner.avi" type="File" typefile="AVI" sizebytes="1231254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="Meteo.pdf" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Meteo.pdf" type="File" typefile="PDF" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="Depends" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Depends" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<file name="Profile.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Depends/Profile.xml" type="File" typefile="XML" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="Identity.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Depends/Identity.xml" type="File" typefile="XML" sizebytes="1284" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
</folder>
<folder name="Documents and Settings" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Documents and Settings" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="etc" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/etc" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="Inetpub" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Inetpub" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="Program Files" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Program Files" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<file name="Identity.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Program Files/Identity.xml" type="File" typefile="XML" sizebytes="1284" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
</folder>
<folder name="Windows" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Windows" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<folder name="Zouzou" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou" type="Folder" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}">
<file name="Profile.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou/Profile.xml" type="File" typefile="XML" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="Identity.xml" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou/Identity.xml" type="File" typefile="XML" sizebytes="1284" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
<file name="Report.doc" key="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}/Zouzou/Report.doc" type="File" typefile="DOC" sizebytes="1254" description="" repositoryid="{A9545674-FD69-4AFE-ACEC-D53767EC22B8}" />
</folder>
</drive>
</code>
How can I do that ?
Thank you very much
|
|
|
|
|
Dude you can't even follow the instructions on this site for posting code. What are the odds that you can accomplish the far more complicated task of developing a software solution?
led mike
|
|
|
|
|
|
|
Sorry, here's the input file
|
|
|
|
|
I am attempting to make a schema where the valid options for a given enumeration are based on the content of another tag. Right now, I am attempting the following: I have an element with name="source", which can contain one of the following enumerated values {"src1", "src2"}. Now, what I want to do is to have another element with name="dependent", such that if tag "source" is set to "src1", the user has options {"opt1", "opt2"} for the "dependent" tag. If tag "source" is set to "src2", I would like the user to be able to set the "dependent" tag to one of {"opt3", "opt4"}. I am presently attempting the following:
<xs:choice>
<xs:sequence>
<xs:element name="source">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="src1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dependent">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="opt1"/>
<xs:enumeration value="opt2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:sequence>
<xs:element name="source">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="src2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="dependent">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="opt3"/>
<xs:enumeration value="opt4"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:choice> However, I am getting the error, "Elements with the same name and in the same scope must have the same type." Is there a way to accomplish what I am trying to do without forcing the tags in either option to have unique names? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
I have a list of employees in excel file and I want to use a Search of a website for all the employees one by one.
I want to do this through my application. My quertion is how can I access that website through my application. And how to use the Search of a website with my own searching criteria.
please reply as soon as possible
|
|
|
|
|
Don't cross post
led mike
|
|
|
|
|
Hi All,
I would like to load a java script array dynamically inside xsl. Suppose I have the following xml
<srsource>
<individualsr>
<srid>srid1</srid>
<srothervalue>srothervalue1</srothervalue>
</individualsr>
<individualsr>
<srid>srid2</srid>
<srothervalue>srothervalue2</srothervalue>
</individualsr>
</srsource>
What I want to do is populate a javascript array during the xsl transformation so that I get an array like the one below when the html page is loaded.
test['srid1'] = 'srothervalue1'
test['srid2'] = 'srothervalue2' and so on..
Could anyone tell me how the above piece of code can be included inside xsl:for-each?
Thanks
Ashvish
|
|
|
|
|
Ashvish wrote: What I want to do is populate a javascript array during the xsl transformation so that I get an array like the one below when the html page is loaded.
Ashvish wrote: Could anyone tell me how the above piece of code can be included inside xsl:for-each?
Not sure I understand your question. I mean whatever you put inside the xsl:for-each is output into the result so like:
<xsl:for-each select="*/individualsr">
test['<xsl:value-of select="./srid"/>'] = '<xsl:value-of select="./srothervalue"/>';
</xsl:for-each>
led mike
|
|
|
|
|
Thanks for the reply. What I am really trying to do is something like
<xsl:variable name="user" select="Login/UserInfo/UserName"/>
<SCRIPT language="JavaScript">
<![CDATA[
...
rowA = new Object()
rowA.data1 = ']]><xsl:value-of select="$user" /><![CDATA['
rowA.data2 = 'needs'
rowA.data3 = 'help'
myTable.append_row(rowA)
...
]]>
</SCRIPT>
This works in Mozilla but not in IE. What could be the reason?
|
|
|
|
|
I don't know if you post got messed up or what but it doesn't make any sense.
led mike
|
|
|
|
|
<xs:element name="person" xmlns:xs="#unknown">
<xs:complextype>
<xs:sequence>
<xs:choice maxoccurs="unbounded">
<xs:element name="employee" type="employee">
<xs:element name="member" type="member">
|
|
|
|
|
Hey Joe, your post is empty. You probably need to read the posting instructions for posting code. They are located on the page you use to post your source code. Also make sure your question, problem, requirements, goal, is clear if you desire a helpful answer.
led mike
|
|
|
|
|
hi all,
i have got an xml of huge no. of data. http://www.propertyworld.com/xml/PW_XMLfeed_15224.xml[^].i have to keep option(some textbox) for user that they will search property by country ,region ,bedroom ,bathroom ,price.And outcomes data will be show in a datalist.I need a solution which gives a faster searching.
How can i solve this?
Waiting for reply.
Snehasish
|
|
|
|
|
snehasish wrote: i have got an xml of huge no. of data.
How huge? Are you not able to provide us with specific information?
snehasish wrote: I need a solution which gives a faster searching.
Databases Engines are designed for fast searching of large amounts of data. XML and related technologies are NOT, and are therefore not a replacement for Database Engines.
led mike
|
|
|
|
|
hi sir,
I have another xml which have 7000 properties.Underneath which have child and sub child element.I think datareader or something like this will not be helpful for searching.If you have any specific answer to solve my problem please reply me.
wating for reply.
snehasish.
|
|
|
|
|
I second led mike. You'll get orders of magnitude better performance out of SQL Express. If you're irreversibly committed to XML, use an XML Reader, but you're just not going to get great performance out of it. Scalability is another issue - assuming you've got XML files, you'll constantly be getting conflicts as two users try to open the same file.
Since you're already using XML, I suggest looking into SQL server support for it (i.e. the XML data type). I've never used it in any serious way, but you can at least take a whack at getting the best of both worlds.
|
|
|
|
|
Hi,
Thanks for your reply.I think you have understood me.I am trying to develop according with your advise.If you get any other reply me.
|
|
|
|
|
Hi,
I have created service in which I am fetching data from database write that in xmldocument and returning XMLDOCUMENT.
But it raised error in client page
"System.Xml.XmlDocument" can not serialized.
is anybody have any solution.
Thanks,
Nagraj
|
|
|
|
|
|
How does one get to execute an Excel document using an XSLT
as well as a dataset inorder to generate the Excel Document?.
|
|
|
|
|
Kagiso Gladwell wrote: How does one get to execute an Excel document using an XSLT
As far as I know, you can't. Nothing executes an Excel document that I am aware of. Microsoft Excel can load and Excel document. Maybe you should try that. I don't know what any of this has to do with XML or XSLT.
led mike
|
|
|
|
|
Hello everybody,
Where does the RSS Feed Downloader feeds in local client system? Please share your knowledge if you have any idea.
Either you love IT or leave IT...
|
|
|
|
|