This question already sort of exists but my application is a little different.
I am brand new to XML and need a little help sorting a file. I know XML files are meant to be sorted by their program and the file itself doens't typically need sorting. However I am using SolidWorks and the material database (custom) utilizes an XML file. I work for a larger company and we have hundreds of custom materials. I am looking for a permanent automated solution to keeping the custom materials sorted alphabetically by name. The XML follows the form:
<mstns:materials xmlns:mstns="http://ift.tt/1uYiBO8" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:sldcolorswatch="http://ift.tt/1uYiB0G" xmlns:xsi="http://ift.tt/ra1lAU" version="2008.03">
<classification name = ALUMINUM GROUP">
<material name = "SAMPLE B" matid="1234" envdata="1">
bla bla bla
</material>
<material name = "SAMPLE A" matid="1235" envdata="1">
bla bla bla
</material>
</classification>
</mstns:materials>
This is obviously a super simplified example. In my actual DB there are about 20 classification sections and in each there can be anywhere between 5 and 100 materials. Obviously this becomes a massive pain to organize by hand.
What I want to do is be able to sort my XML file so that my material sections are organized by name. Right now I am doing this by hand with cut and paste and it's a huge pain in the neck. I have researched this but unfortunately I don't have the basic knowledge to understand half the pages I read but it seems to be a persistent problem that people face. I do a fair bit of coding but never before in XML.
Can anyone point me in the proper direction or suggest a (preferably free) software package that may get me started? Thanks!
No comments:
Post a Comment