473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Can we convert xml format to other xml format like (OEBPS)

hi
i have xml file , i want to transform its format to OEBPS format by PHP, is it possible to transform xml conversion to other xml format ?

Kindly reply me as soon as possible

Thanks
Sachin Sharma
Nov 6 '09 #1
19 2832
Dormilich
8,658 Expert Mod 8TB
if you have an appropriate XSL file, PHP can do the conversion for you.
Nov 6 '09 #2
thanks for ur reply
can your help me with code how php will do this conversion ?

Thanks
Sachin Shastri
Nov 6 '09 #3
Dormilich
8,658 Expert Mod 8TB
PHP 5 has its own XSL processing class, see its documentation.
Nov 6 '09 #4
thanks
But i am not geting with OEBPS format
Can u help me in that , how we transform in this format

Thanks
Shastri
Nov 6 '09 #5
Dormilich
8,658 Expert Mod 8TB
as I mentioned, you have to write an XSL file for that.
Nov 6 '09 #6
ok but how xsl convert it into OEBPS format
Nov 6 '09 #7
Dormilich
8,658 Expert Mod 8TB
that depends on what you have, see also this tutorial
Nov 6 '09 #8
see this link
http://www.idpf.org/oebps/oebps1.2/index.htm
i want to convert my xml into Open eBook Publication Structure Specification Version 1.2 it also a xml type coding

see i want to convert my xml into this format through php

The OEBPS/As You Like It.opf file:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?> <!DOCTYPE package PUBLIC "+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN" "http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd"> <package unique-identifier="Package-ID"> <metadata> <dc-metadata xmlns:dc="http://purl.org/dc/elements/1.0" xmlns:oebpackage="http://openebook.org/namespaces/oeb-package/1.0"> <dc:Identifier id="Package-ID">ebook:guid-6B2DF0030656ED9D8</dc:Identifier> <dc:Title>As You Like It</dc:Title> <dc:Creator role="aut">William Shakespeare</dc:Creator> <dc:Identifier>0-7410-1455-6</dc:Identifier> <dc:Subject></dc:Subject> <dc:Type></dc:Type> <dc:Date event="publication">3/24/2000</dc:Date> <dc:Date event="copyright">1/1/9999</dc:Date> <dc:Identifier scheme="ISBN">0-7410-1455-6</dc:Identifier> <dc:Publisher>Project Gutenberg</dc:Publisher> <dc:Language></dc:Language> </dc-metadata> </metadata> <manifest> <item id="4915" href="book.html" media-type="text/x-oeb1-document"/> <item id="7184" href="images/cover.png" media-type="image/png" /> </manifest> <spine> <itemref idref="4915"/> </spine> </package>
Nov 6 '09 #9
Dormilich
8,658 Expert Mod 8TB
and what is your XML? usually, you have to write xsl files yourself (some IDEs may provide conversion of one known xml format into another known one)
Nov 6 '09 #10
1) can we do conversion of xml to xsl by pragmatically in php ?

2) can we do conversion of XSL format to OEBPS format by pragmatically in php ?

Is these are possible or not ?
Nov 6 '09 #11
Dormilich
8,658 Expert Mod 8TB
1) I think you misunderstand here. you do xml-to-xml conversion using xsl and php
2) Yes, if you feed PHP with an input xml and an input xsl
Nov 6 '09 #12
thanks i got ur point
but can we do conversion of XSL format to OEBPS format by pragmatically in php ?
Nov 6 '09 #13
Dormilich
8,658 Expert Mod 8TB
why do you want to convert xsl? didnt you want to convert your xml file?
Nov 6 '09 #14
yeah i want to convert my xml but how i can get OEBPS format.

according to u first i will convert my xml into xsl
Nov 6 '09 #15
Dormilich
8,658 Expert Mod 8TB
@sachinshastri
I never said that. I said, youd need an XSL file to do the conversion.

here is a part of my project, using xml conversion.
on line 17 I pass an xml file (name), read from the input object $inSeite_in, via a selfmade wrapper to PHPs XSLTprocessor class.
on line 18 I do the same with the xsl file name
line 20 triggers the conversion and returns the result xml (in this case xhtml)
Expand|Select|Wrap|Line Numbers
  1.     protected function Transform(
  2.         Seite $inSEITE_in, 
  3.         $sy_par  = '', 
  4.         $f_empty = XSLT_FORCE_RESULT
  5.     ) 
  6.     {
  7.         # set parameter correctly
  8.         $param = ($sy_par === '' and isset($this->ID)) ? $this->ID : $sy_par;
  9.         $mp_param = ($inSEITE_in->PAR_NAME) ? $inSEITE_in->getValue('PAR_ARRAY', $param) : array();
  10.  
  11.         try 
  12.         {    # load XSLT
  13.             $inXSLT_process = XSLTransform::getInstance();
  14.             # set parameter
  15.             $inXSLT_process->emptyResult = (bool) $f_empty;
  16.             # load files
  17.             $inXSLT_process->loadXML($inSEITE_in->XML);
  18.             $inXSLT_process->loadXSL($inSEITE_in->XSL);
  19.             # processing
  20.             $data = $inXSLT_process->Process($mp_param);
  21.         }
  22.         catch (ProcException $pe)
  23.         {
  24.             ErrorLog::add($pe, __CLASS__);
  25.             trigger_error(500, E_USER_ERROR);
  26.             return '<!-- Parser Error -->'; // ???
  27.         }
  28.         return $data;
  29.     }
  30.  
Nov 6 '09 #16
thanks for ur valuable support
i try with it but i am yet confused with OEBPS format.

Thanks
Shastri
Nov 6 '09 #17
Dormilich
8,658 Expert Mod 8TB
basicly you have to find out which xml element of your xml corresponds to which xml element of oebps xml.
Nov 6 '09 #18
yeah i am not getting way to convert it into oebps format

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <!DOCTYPE package 
  3.   PUBLIC "+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN"
  4.   "http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd">
  5. <package>
  6.    metadata
  7.    manifest
  8.    spine
  9.    guide
  10. </package>
Nov 6 '09 #19
Dormilich
8,658 Expert Mod 8TB
thats not correct.

youve written there text, instead of xml tags

<package> must have as children elements, in this order: <metadata>, <manifest>, and <spine>, and optionally may include <tours> and/or <guide>. The 'unique-identifier' attribute is required for <package> (see comment for <dc:Identifier>.)
Nov 6 '09 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: ohaya | last post by:
Hi, I'm working with a date string with a format as follows: Sat Dec 25 21:32:59 EST 2004 and I want to compare it to another date string of the format: 7/28/2004
12
by: dixie | last post by:
Can someone familiar with Access 2003 please answer this question? I am asking because I don't have the use of A2003. When Access 2003 finds an Access 2000 database, does it come up with some...
3
by: Jon S via DotNetMonster.com | last post by:
Hi all, Is there a way to convert an Access.mdb from one format (say Access '97 or Access 2000) to Access 2002 format using ADO.NET and C#??? I know how to do it manually using the Access DBMS...
1
by: James Pose | last post by:
Convert.Int32 fails for "0" but works fine for all other numbers. This does not work on one machine when "0" it works fine on other machines Convert.ToInt32(“0”); gives exception {"Input...
13
by: kbperry | last post by:
Hi all, Background: I need some help. I am trying to streamline a process for one of our technical writers. He is using Perforce (version control system), and is constantly changing his word...
8
by: platinumhimani | last post by:
-How to convert any image(8,16,24,32 or 64-bit) to 8-bit grayscale -i have tried to convert a 24-bit image to grayscale using setpixel and getpixel functions, in vb.net but i am unable to save...
6
by: tshad | last post by:
Apparently, I can't do: Dim da2 As New OleDb.OleDbDataAdapter("Select PR, Convert(varchar,getchar(),1),F1, F2, F5, Sum(F4) from temp .... I am getting this error. 'undefined function...
4
by: Ashraf Ansari | last post by:
Hi, How Can I convert MM/dd/yyyy format into dd/MM/yyyy and the date which is converted into dd/MM/yyyy should be in DateTime format. I do not want to store it as a string. Please help ...
5
by: sonu | last post by:
hey good morning ...... how to convert a video file in .flv format in php for linux hosting......is there any package whis provide this facility . Can i use ffmpeg for linux hosting...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.