Extract XML from zipped docx file

Wednesday, 28 June 2017 · 4 messages
DS
Dharmendra Singh28 Jun 2017 15:22 #
Hi All, I have a zipped docx i have to extract the XML from the zipped docx file how can i achieve this, and what function will be used for that. Thanks & Regards Dharmendra Kumar Singh
CG
Christian Grün28 Jun 2017 15:28 #
Hi Dharmendra, In our documentation, there are some examples (e.g. [1]) that demonstrate how to access the contents of MS Office files. Hope this helps, Christian [1] http://docs.basex.org/wiki/Archive_Module#archive:update
Quoted text · Dharmendra Singh · 1 line
Am 28.06.2017 15:22 schrieb "Dharmendra Singh" <dharam.mahi at gmail.com>:
Hi All, I have a zipped docx i have to extract the XML from the zipped docx file how can i achieve this, and what function will be used for that. Thanks & Regards Dharmendra Kumar Singh
DS
Dharmendra Singh28 Jun 2017 16:01 #
Hi Christian, Thanks for your reply i tried to extract the XML from Zipped docx file by below code
let $sourceDir := 'D:\2017\doctest\Elastic search.zip'
let $archive  := file:read-binary($sourceDir)
for $entry in archive:entries($archive)
for $extract in  fn:parse-xml(archive:extract-text($archive, $entry))
 return $extract
but it throwing error : [experr:ARCH0004] String conversion: Invalid XML character (#3). so what am i doing wrong here Thanks & Regards Dharmendra Kumar Singh
Quoted text · Christian Grün · 1 line
On Wednesday, 28 June 2017 6:58 PM, Christian Grün <christian.gruen at gmail.com> wrote:
Hi Dharmendra, In our documentation, there are some examples (e.g. [1]) that demonstrate how to access the contents of MS Office files. Hope this helps, Christian [1] http://docs.basex.org/wiki/Archive_Module#archive:update
Quoted text · Christian Grün · 11 lines
Am 28.06.2017 15:22 schrieb "Dharmendra Singh" <dharam.mahi at gmail.com>: > Hi All, > > > I have a zipped docx i have to extract the XML from the zipped docx file how can i achieve this, and what function will be used for that. > > > Thanks & Regards > > > Dharmendra Kumar Singh
CG
Christian Grün28 Jun 2017 17:46 #
Quoted text · Dharmendra Singh · 1 line
> so what am i doing wrong here
First of all, it would be helpful if you used variable names that are not misleading. Is $sourceDir supposed to point to a directory or a ZIP archive? Next, it would be awesome if you could iteratively simplify your examples until the error disappears. This will increase chances for helpful feedback from the list.
Quoted text · Dharmendra Singh · 2 lines
> i tried to extract the XML from Zipped docx file by > below code
Files of type docx are archives in itself (once again, please see original example). If your docx files are zipped, you need to additionally unzip the result of your archive.
Quoted text · Dharmendra Singh · 47 lines
On Wed, Jun 28, 2017 at 4:01 PM, Dharmendra Singh <dharam.mahi at gmail.com> wrote: > Hi Christian, > > let $sourceDir := 'D:\2017\doctest\Elastic search.zip' > let $archive := file:read-binary($sourceDir) > for $entry in archive:entries($archive) > for $extract in fn:parse-xml(archive:extract-text($archive, $entry)) > return $extract > > but it throwing error : [experr:ARCH0004] String conversion: Invalid XML > character (#3). > > > Thanks & Regards > > Dharmendra Kumar Singh > > > On Wednesday, 28 June 2017 6:58 PM, Christian Grün > <christian.gruen at gmail.com> wrote: > > > Hi Dharmendra, > > In our documentation, there are some examples (e.g. [1]) that demonstrate > how to access the contents of MS Office files. > > Hope this helps, > Christian > > [1] http://docs.basex.org/wiki/Archive_Module#archive:update > > > Am 28.06.2017 15:22 schrieb "Dharmendra Singh" <dharam.mahi at gmail.com>: > > Hi All, > > I have a zipped docx i have to extract the XML from the zipped docx file how > can i achieve this, and what function will be used for that. > > Thanks & Regards > > Dharmendra Kumar Singh > > > >

⚡Generated with XQuery