03-31-2011, 04:20 PM | #1 |
Member
Posts: 13
Karma: 2136218
Join Date: Jan 2010
Device: BEBOOK
|
XML files and XSD file to EPUB
I have downloaded documentation in an XML format from the siemens website.
It is zip folder with: - XML file Code:
<?xml version="1.0" encoding="utf-8"?> <export version="1.0" type="xml" xmlns:child="http://www.schema.de/2002/ST4/Transformation/child" xmlns:attribute="http://www.schema.de/2002/ST4/Transformation/attribute" xmlns:outgoinglink="http://www.schema.de/2002/ST4/Transformation/outgoinglink" xmlns:incominglink="http://www.schema.de/2002/ST4/Transformation/incominglink" xmlns:parentlink="http://www.schema.de/2002/ST4/Transformation/parentlink" xmlns:stobject="http://www.schema.de/2002/ST4/Transformation/stobject" xmlns:external="http://www.schema.de/2002/ST4/Transformation/external"> <metadata> <documentid>0ef014e9-7e5d-4afe-8924-232b265888bb</documentid> <title>MDM - WinCC: Working with WinCC</title> <creationdate>3/31/2011 1:58:00 PM</creationdate> <created_by>XXXXXXXXXXXX</created_by> <url> </url> </metadata> <node title="Working with Projects"> <topic title="Working with Projects" href="datavalues/en-US/T_2350636427_16484426123_en-US_3.xml" /> <topic title="Opening WinCC Explorer" href="datavalues/en-US/T_10393969035_16484426123_en-US_4.xml" /> AND SO ON .... <node title="Source documents"> <topic title="
 " href="datavalues/T_documentList.xml" /> </node> </export> Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!-- ********************************************************** Siemens AuD My Documentation Manager XML Export Structure SCHEMA DEFINITION (XMLExport.xsd) Copyright© 2007 SIEMENS AG ********************************************************** Version 1.00 2007-11-27 ********************************************************** Aenderungen: ********************************************************** --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="1.0"> <xs:element name="created_by"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:element> <xs:element name="creationdate"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:element> <xs:element name="documentid"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:element> <xs:element name="export"> <xs:complexType> <xs:sequence> <xs:element name="metadata" type="metadataType"/> <xs:element name="structure" type="structureType" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="version" use="required"> <xs:simpleType> <xs:restriction base="xs:decimal"/> </xs:simpleType> </xs:attribute> <xs:attribute name="type" use="required"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> <xs:complexType name="metadataType"> <xs:sequence> <xs:element ref="documentid"/> <xs:element ref="title"/> <xs:element ref="creationdate"/> <xs:element ref="created_by"/> <xs:element ref="url"/> </xs:sequence> </xs:complexType> <xs:complexType name="nodeType"> <xs:attribute name="title" use="required"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:attribute> <xs:attribute name="href" use="required"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:complexType name="structureType"> <xs:sequence maxOccurs="unbounded"> <xs:element name="topic" type="nodeType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="structure" type="structureType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="title" use="required"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:element name="title"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:element> <xs:element name="url"> <xs:simpleType> <xs:restriction base="xs:anyURI"/> </xs:simpleType> </xs:element> </xs:schema> - a subfolder 'datavalues' with all the chapters in XML format How can I convert this zipfile to an epub file? I tried calibre, but it won't accept the zip file. thanks Last edited by janneman; 03-31-2011 at 04:24 PM. |
03-31-2011, 05:12 PM | #2 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Ask Siemens to do it?
An XML file has no standard. It is a way of define arbitrary content however you wish with a consistent parsing mechanism. The interpretation requires the application of the schema definition to each element. There are some generalized parsers that that decode the data using the defined schema and provide some level of interpretation but there is no converter that I know of that can interpret an arbitrary XML file using its defining DTD or schema and then automatically produce another document in a different format. Dale |
Advert | |
|
03-31-2011, 05:21 PM | #3 |
Member
Posts: 13
Karma: 2136218
Join Date: Jan 2010
Device: BEBOOK
|
|
04-01-2011, 07:40 AM | #4 |
Member
Posts: 13
Karma: 2136218
Join Date: Jan 2010
Device: BEBOOK
|
The xml is in Schema ST4 format
http://de.wikipedia.org/wiki/SCHEMA_ST4 [german wikipedia only] http://www.schema.de/eds/index.php?lang=en Is there an easy way to convert these? |
04-01-2011, 10:07 AM | #5 | ||
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Quote:
Dale |
||
Advert | |
|
04-04-2011, 02:49 PM | #6 |
Member
Posts: 13
Karma: 2136218
Join Date: Jan 2010
Device: BEBOOK
|
You can download the documentation from the website in PDF, RTF and XML.
I tried converting the PDF and the RTF formats to epub, using calibre. But this doesn't give the result I want. Unfortunately I can't find a tool to convert the ST4 XML format to something calibre understands. Thanks for the help though |
04-04-2011, 04:03 PM | #7 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
RTF is read by all sorts of programs and some eBook readers will read it directly. It should be fairly easy to convert RTF to something else, more eBook friendly. For example you can read RTF into Open Office writer and use an available macro to make a ePUB.
|
04-05-2011, 07:57 AM | #8 |
Member
Posts: 13
Karma: 2136218
Join Date: Jan 2010
Device: BEBOOK
|
Indeed, my bebook also supports RTF. But since the RTF is + 35 MB in size, it won't open.
I tried splitting in smaller chunks, this worked but the layout is not as good as I want. I tried converting the full rtf with calibre, but after converting at 90% CPU usage for over an hour I gave up Will look into the macro you mentioned this evening. |
04-08-2011, 05:23 PM | #9 |
Member
Posts: 13
Karma: 2136218
Join Date: Jan 2010
Device: BEBOOK
|
Ok, so I don't like the macro thing. Also the RTF is +30MB.
Being curious as to how all this is possible when you start from perfectly ordered data in an xml I started coding some XSL (My second go at it) and i'm making a bit of progress. I think this is a better option (compared to converting from RTF) because: - I start from XML which has the document structure - I will be converting more documentation in the same format - I learn some XML and XSL However, I still have to find a way to convert XML + XSL to EPUB The document structure is: / /XmlExport.xml = a list with links to all topics /en-us = a folder with all topics in seperate xml files /en = a folder with all images the XSL for the XmlExport.xml is : Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- Edited by CAJAC --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <ul> <xsl:for-each select="export/node"> <li> <xsl:value-of select="@title" /> </li> <ul> <xsl:for-each select="node/topic"> <li><a> <xsl:attribute name="href"> <xsl:value-of select="@href" /> </xsl:attribute> <xsl:value-of select="@title" /></a></li> </xsl:for-each> </ul> </xsl:for-each> </ul> </body> </html> </xsl:template> </xsl:stylesheet> |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
converting an XML file (making a dictionary) | meehrcat | Conversion | 2 | 06-13-2011 10:32 AM |
Converting multiple HTML files into one EPUB file | bigdukesix | ePub | 3 | 03-08-2011 12:12 PM |
Problem Converting pdf files to epub file | clover_kid | Calibre | 2 | 10-28-2010 05:32 PM |
iLiad manifest.xml file order | dedo | iRex Developer's Corner | 2 | 10-05-2009 07:47 PM |
iLiad which program make a new manifest.xml file? | harpum | iRex Developer's Corner | 3 | 06-23-2009 09:45 AM |