Convert XML to XMP and inject XMP

Post Reply
nmichael
Newbie
Posts: 8
Joined: Wed Oct 28, 2015 9:37 pm

Convert XML to XMP and inject XMP

Post by nmichael »

Hi,

I have some trouble to ge the following task to work.

I use the following XML to preflight uploaded files.
After the preflight I want to change the last entry <datenstatus>.
I see, that Switch can only edit XMP-Data.
Is there a way to convert the XML to XMP and edit this?
Or is there another way to edit the XML?

Kind Regards
Nico

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<bestellung>
    <bestellnummer>BO079562</bestellnummer>
    <bestelltyp>Offsetdruck</bestelltyp>
    <kundennummer>K000001</kundennummer>
    <fertigstellungstermin>06.03.2019</fertigstellungstermin>
    <form>Rechteck</form>
    <endformat_width>210</endformat_width>
    <endformat_height>148</endformat_height>
    <datenformat_width>216</datenformat_width>
    <datenformat_height>154</datenformat_height>
    <druck>4/0-farbig</druck>
    <seitenanzahl>1</seitenanzahl>
    <stanzen>0</stanzen>
    <material>BD</material>
    <qualitaet>seidenmatt</qualitaet>
    <datencheck>Basis-Datencheck</datencheck>
    <datenstatus>beim Datencheck</datenstatus>
</bestellung>
r.zegwaard
Member
Posts: 93
Joined: Fri Jul 08, 2011 10:31 am
Location: The Netherlands

Re: Convert XML to XMP and inject XMP

Post by r.zegwaard »

If you've got the scripting-module, you could write a script for it.
Another option would be to use a XSLT-transformation. Wouldn't need the scripting-module for XSLT
nmichael
Newbie
Posts: 8
Joined: Wed Oct 28, 2015 9:37 pm

Re: Convert XML to XMP and inject XMP

Post by nmichael »

Unfortunately I don't have access to the scripting module.
I tried XSLT but didn't get a proper result - I am pretty sure I did not understand how to use it correctly .

I have set up this stylesheet, but after the conversion "XMP Inject" did not show any XPaths to edit.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="1.0">
    <xsl:output method="xmp" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
        <bestellung>
			<datenstatus>
                <xsl:value-of select="/field-list/field[tag='datenstatus']/value"/>
			</datenstatus>
        </bestellung>
    </xsl:template>
</xsl:stylesheet>
Post Reply