This XML file contained archived news stories for all of last year. I was asked to sort these stories by story categor[y|ies] into new XML files.
big_story_export.xml
turns into
lifestyles.xml
food.xml
nascar.xml
...and so on.
I got the job done using a one-off python script, however, I originally attempted this using XSLT. This resulted in frustration as my XPATH selections were crapping the bed. Test files were transformed perfectly, but putting the big file up against my style sheet resulted in ...nothing.
What strategies do you recommend for ensuring that files like this will run through XSLT? This was handed to me by a vendor, so imagine that I don't have a lot of leverage when it comes to defining the structure of this file.
If you guys want code samples, I'll put some together.
If anything, I'd be satisfied with some tips for making XML+XSLT work together smoothly.
I was using python's libxml2 & libxslt to process this. I'm looking into xsltproc now.
It seems like a good tool for these one-off situations. Thanks!
@diomidis-spinellis
It's well-formed, though (as mentioned) I don't have faculties to discover it's validity.
As for writing a Schema, I like the idea.
The amount of time I invest in getting this one file validated would be impractical if it were a one-time thing, though I foresee having to handle more files like this from our vendor.
Writing a schema (and submitting it to the vendor) would be an excellent long-term strategy for managing XML funk like this. Thanks!