Jump to content

Restructuring data hierarchy


squeal

Recommended Posts

I am new to XML and to programming in general, so go easy on me. I am working on a project to create and maintain a preset database for a digital audio units. We are looking to take presets from various older products and restructure them for use in a new product. I have gone through the XML and XSL tutorials, and have read some on XPath. It seems to me that XSL would be useful for rearranging the parent-child structures. It also seems that XPath may be used to parse the data for use in the embedded hardware. Does this sound feasible? Am I way off?

Link to comment
Share on other sites

XSLT could rearrange one XML to another XML, so yes. If all this database is contained from within one or more XML files, it could be rearranged.Various problems however may arise due to one major drawback of XML: It has to be fully loaded in the parser, before it's parsed, so if the database is huge, it might take some time before you see the results.I would recommend that you use a server side scripting language to execute the transformation, but that's a thing to worry about later.

Link to comment
Share on other sites

It's called "server side" scripting. It refers to all languages which are performed on the server. Such examples are PHP, ASP(.NET), Cold Fusion, JSP, Perl, etc.They can do everything you can't otherwise do with plain markup languages. That's the best way to describe them I think.W3Schools has PHP tutorial, ASP and ASP.NET tutorials. Other tutorials are avaiable on a variety of other places on the internet. If you ask me, ASP(.NET) is better for dealing with XMLs, because it has better and build in support for them. PHP has build in support for XML, but not XSLT. It requres extension which so far I don't know how to run.The important thing with server side scripting and XSLT is that normally, when you preview the XML file, the whole file is downloaded along with the XSLT. Then, the browser performs the transformation and shows you the output. When you look at the source you'll see the XML source.When you use server side scripting, the server side page is requested, it gets the XML and XSLT from the server instantly (scince the server side scripting file and the XML and XSLT are on the same machine), process them and gives the end result to the browser. The browser only processes the final output for display, so when you look at the source, you see the output. When the XML file is huge, this means the browser will only parse the fragment shown on screen, not the whole XML file, which in terms increases browser performance a lot. It may slow down the server if the requests for the files are very frequent, but such cases are not that often.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...