Jump to content

Referencing parts of an XML file from another file

Guest husker

Recommended Posts

Hi everyone!I have a rather broad question regarding a project I'm working on. In short, the question is: how do you reference parts of an XML file from another one?Here comes the long version:The project is basically a very simple, XML-based content management system (for our research group at a university). The contents are stored as XML, their structure is modelled using XML Schema. From these, the whole website is generated by XSL Transformations, fed to a XSLT processor by a makefile.Naturally, we do not want to store all our information in a single XML file, so we have multiple files. For example, there is a file storing person records, and another one for publications.Now, I want a publication entry to point to its authors (for example). How would I go about that?First, I was thinking XInclude: in a preprocessing step, resolve all XIncludes so that the author information actually gets copied into the respective publication entries. Then, continue as normal.However, tool support for XInclude seems to be scarce, and I haven't been able to get those XPointers to work properly.Then, there are keys and key references in XML Schema. But that mechanism is not applicable across multiple files.Of course, I could just implement my own mechanism via XSLT, but I really thought something like this should be possible out of the box. On the other hand, I'm getting the vibe that I'm doing something fundamentally wrong. That I'm somehow using the whole XML/XSL/XSD stuff "the wrong way", or applying it to a problem it's not intended for.So, is there a simple way to solve this? Have I overlooked something obvious? Or does the whole approach seem weird to you, and I should go about this completely different?Any help/suggestions would be much appreciated!

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...