[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XMP to XML translation?

  • From: "Dan B." <danb@kempt.net>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Fri, 13 Apr 2012 18:09:28 -0400

Re:  XMP to XML translation?
Michael Hopwood wrote:
> Hi all,
> 
>  
> 
> I’m looking for a quick and simple method to transform XMP files into 
> well-formed XML, 

 From a quick look at
http://en.wikipedia.org/wiki/Extensible_Metadata_Platform,
it looks like XMP is RDF/XML.  (However, I can't tell if my quick look
caused me to miss something saying that XMP might also be written out
something other than RDF/XML.)

If is always RDF/XML, then XMP already is well-formed XML.  (Make sure
you know what "well-formed" does, and doesn't, mean for XML.)  It sounds
like you really meant "valid" (against some schema or DTD).

 > possibly according to an extremely simplified schema
> (i.e. effectively a root node and a list of allowed elements from 
> selected namespaces, all with cardinality 0-n).
> 
>  
> 
> The use case here is to import XMP data into an XSLT engine I’m using, 
> but the existing software can’t handle the RDF/XML of the raw XMP.

You probably want an RDF reader, not a general-purpose XML tool.  When
RDF is serialized into RDF/XML, there are lots of options (lots of
variation in syntax that mean exactly the same thing, but have quite
different XML structure).

Unless you know for sure that only certain syntactic options will be
used, you'd have to handle the multiple RDF/XML options, and that's not
easy in XSLT (or at least not in a single-step transform).


> Since the XMP is relatively flat, I thought there might be a standard or 
> at least well-known way to get this stuff into ...

The standard way to get RDF/XML into memory is to use a real RDF/XML
reader (as opposed to trying to do it with XSL).  A real RDF/XML reader
would already handle all those syntactic variations, and leave you with
the same structures in memory regardless of which syntactic option was
chosen when the RDF/XML was created.


 > a very simple XML form,
 > from whence it could be input into my XSLT engine (which auto-detects
 > the “schema” of the input data before creating an XSLT to transform it
 > and future uploads to a new schema).

Then, you could probably use the RDF/XML reader tool to write out XML
for input to your XSLT transform.

Or you might be able to use the RDF/XML reader tool to write the
data back out into RDF/XML, but using only known subset of the
possible syntactic variations, so that your XSLT transform only has
to handle those variations.


Daniel


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.