XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> + Error in Stylus Studio - canno... (2)
-> + Saxon Assign (2)
-> - License Authentication Failed (1)
-> + Stylus Studio 2007 Download (2)
-> + EDI to XML validation (2)
-> + Reports: can't remove "undead"... (3)
-> + Document Wizard Incomplete (6)
-> + Opening xml converter (4)
-> + Node depth limit with MySQL? (5)
-> + Basics (2)
-> - Node depth limit with MySQL? (1)
-> + Creating an XML Schema from a ... (4)
-> - Issue with XSD (1)
-> + XSL-FO and Apache FOP (2)
-> + How Come Stylus Studio Fails T... (6)
-> + no suitable driver (8)
-> + 211,19: no declaration found f... (6)
-> - Validate HEX (1)
-> + Crashing when connected to dat... (3)
-> - Interface with quickbooks (1)
-> - CDATA control (1)
-> + [resolved] Namespace (and pref... (5)
-> - Hiding and Revealing Child Nod... (1)
-> + Cannot see values in Watch whe... (4)
-> - Help with CSV to XML and Regio... (1)
-> + How do I verify "opt=yes" URI ... (4)
-> - Stylus Studio claims xsd is in... (1)
-> + Can a generated XSD be used in... (4)
-> + I am not a developer I'm just ... (2)
-> + Stylus crash when deleting dat... (6)
-> - Preserving Structure (1)
-> - Preserving Structure (1)
-> - HL7 ORU group tags (1)
-> + Fixed Length Record Layout to ... (2)
-> + WebService Connect (6)
-> - WebService conection problems (1)
-> + Could not detect EDI dialect a... (3)
-> + I am a bookkeeper not a progra... (2)
-> + fatal error (4)
-> - Saxon linebreak (1)
-> + task scheduler (2)
-> - Number of Elements in Grid vie... (1)
-> + Compile Java (2)
-> + What happened to the EDI Wizar... (15)
-> + setting Transformer for java b... (3)
-> + XML Schema Documentation Gener... (3)
-> + EANCOM xsd-files (4)
-> + Failure of CDATA converting pr... (4)
-> + XML File created from text fil... (3)
-> + After purchase AND activation ... (2)
-> + XQuery Format of XML code snip... (4)
-> + Error during conversion (9)
-> - testing for empty nodes (1)
-> + edi converter - java fails (10)
-> + ddtek:serialize (3)
-> - File explorer view (1)
-> - Java Extension Functions (1)
-> + err:FODC0004 (18)
-> - Removing Attributes when Null (1)
-> + CDATA preservation (6)
-> + Help converting xml report to ... (2)
-> + Converting text to XML issue (3)
-> - example not working (1)
-> + XML Editing (2)
-> + Multiple EDI messages within s... (5)
-> + Mapping RDBMS and XML Schema t... (2)
-> + MySQL Database importing (2)
-> + XSD validation using XSV fails... (3)
-> + Is this really well-formed? (3)
-> + HL7 EDI to XML problems -'ORU_... (11)
-> + How do I modify the Xquery to ... (2)
-> + XML mapping difficulty (3)
-> + XLST Conversion (2)
-> + HTML TO XSL Conversion (2)
-> - Convert an EBCDIC file to XML (1)
-> + License Manager still indicate... (4)
-> + Still sometimes getting beat b... (2)
-> + What versions of MySQL are sup... (5)
-> - External XSLT processor proble... (1)
-> + DDEE0082 Erro Internal system ... (6)
-> + Calling function from .NET C# (2)
-> + Stylus studio projects bound t... (3)
-> + Report Designer mistakenly gen... (3)
-> + Choose Nodes in pipelines (3)
-> + Custom external processor and ... (2)
-> + predefined (4)
-> + translate function in java (2)
-> + XMLPipeline trouble in Linux (7)
-> + Converting Custom EDI Message ... (2)
-> + tab delimetered file with vari... (2)
-> + XML validation with XSD (2)
-> + Missing documentation: SSL_Cer... (2)
-> + Parse Xcel input file which is... (2)
-> + XML Publisher post processors (2)
-> + Alignment of table items in XM... (2)
-> + XML to PDF using XML Publisher (2)
-> + Blurry Background image / Vect... (4)
-> + URIResolver error on command l... (2)
-> + stylus studio - the (3)
-> + problem with omit from output ... (3)
-- Previous [481-500] [501-520] [521-540] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
zeinah KSubject: From WordML to XML
Author: zeinah K
Date: 08 Apr 2005 05:26 AM
Hi
I have the wordml document with a user-defined schema called "Wordtest" attached.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?mso-application progid="Word.Document"?>
<w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:ns0="schemas-WordTest" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve"><o:DocumentProperties><o:Title>My TitleMy Sub TitleSome text goes here</o:Title><o:Author>AIS</o:Author><o:LastAuthor>AIS</o:LastAuthor><o:Revision>1</o:Revision><o:TotalTime>1</o:TotalTime><o:Created>2005-04-08T09:14:00Z</o:Created><o:LastSaved>2005-04-08T09:15:00Z</o:LastSaved><o:Pages>1</o:Pages><o:Words>7</o:Words><o:Characters>41</o:Characters><o:Company>AIS</o:Company><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs><o:CharactersWithSpaces>47</o:CharactersWithSpaces><o:Version>11.6359</o:Version></o:DocumentProperties><w:fonts><w:defaultFonts w:ascii="Times New Roman" w:fareast="Times New Roman" w:h-ansi="Times New Roman" w:cs="Times New Roman"/></w:fonts><w:styles><w:versionOfBuiltInStylenames w:val="4"/><w:latentStyles w:defLockedState="off" w:latentStyleCount="156"/><w:style w:type="paragraph" w:default="on" w:styleId="Normal"><w:name w:val="Normal"/><w:rPr><wx:font wx:val="Times New Roman"/><w:sz w:val="24"/><w:sz-cs w:val="24"/><w:lang w:val="FR" w:fareast="FR" w:bidi="AR-SA"/></w:rPr></w:style><w:style w:type="character" w:default="on" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:semiHidden/></w:style><w:style w:type="table" w:default="on" w:styleId="TableNormal"><w:name w:val="Normal Table"/><wx:uiName wx:val="Table Normal"/><w:semiHidden/><w:rPr><wx:font wx:val="Times New Roman"/></w:rPr><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="list" w:default="on" w:styleId="NoList"><w:name w:val="No List"/><w:semiHidden/></w:style></w:styles><w:shapeDefaults><o:shapedefaults v:ext="edit" spidmax="2050"/><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout></w:shapeDefaults><w:docPr><w:view w:val="print"/><w:zoom w:percent="100"/><w:doNotEmbedSystemFonts/><w:proofState w:spelling="clean" w:grammar="clean"/><w:attachedTemplate w:val=""/><w:defaultTabStop w:val="708"/><w:hyphenationZone w:val="425"/><w:punctuationKerning/><w:characterSpacingControl w:val="DontCompress"/><w:optimizeForBrowser/><w:validateAgainstSchema/><w:saveInvalidXML w:val="off"/><w:ignoreMixedContent w:val="off"/><w:alwaysShowPlaceholderText w:val="off"/><w:compat><w:breakWrappedTables/><w:snapToGridInCell/><w:wrapTextWithPunct/><w:useAsianBreakRules/><w:dontGrowAutofit/></w:compat></w:docPr><w:body><wx:sect><ns0:Fonction><w:p><w:pPr><w:rPr><w:lang w:val="EN-GB"/></w:rPr></w:pPr><ns0:Title><w:r><w:rPr><w:b/><w:lang w:val="EN-GB"/></w:rPr><w:t>My Title</w:t></w:r><w:proofErr w:type="spellStart"/></ns0:Title><ns0:SousTitre><w:proofErr w:type="spellEnd"/><w:r><w:rPr><w:lang w:val="EN-GB"/></w:rPr><w:t>My Sub Title</w:t></w:r><w:proofErr w:type="spellStart"/></ns0:SousTitre><ns0:Texte><w:proofErr w:type="spellEnd"/><w:r><w:rPr><w:lang w:val="EN-GB"/></w:rPr><w:t>Some text goes here</w:t></w:r></ns0:Texte></w:p></ns0:Fonction><w:sectPr><w:pgSz w:w="11906" w:h="16838"/><w:pgMar w:top="1417" w:right="1417" w:bottom="1417" w:left="1417" w:header="708" w:footer="708" w:gutter="0"/><w:cols w:space="708"/><w:docGrid w:line-pitch="360"/></w:sectPr></wx:sect></w:body></w:wordDocument>

I want to convert this wordml into xml like
<?xml version="1.0" encoding="UTF-8"?>
<Fonction>
<Title><b>My Title</b></Title>
<SousTitre>My Subtitle</Soustitre>
<Texte>Some text goes here</Texte>
</Fonction>

I want to preserve the user defined tags in the schema and also the formatting applied by word.
I saw an xsl on this forum n tried to use that, but it removes the user defined tags.I have no knowledge of how to write an xsl.
Could Anyone help me with this please?
Thanks
Zeinah

Postnext
Minollo I.Subject: From WordML to XML
Author: Minollo I.
Date: 08 Apr 2005 10:26 PM
Your desire to generate an XML document consistent with the structure you are describing seems to be in contrast with the second requirement you are mentioning "I want to preserve the user defined tags"; you'll need to decide which of the two you want.

> Could Anyone help me with this please?

We are more than willing to help you, but you will need to learn some XSLT or XQuery if you want to succeed in any XML-to-XML transformation you are planning to do.
This XSLT does (part of) what (I guess) you are looking for:

<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:ns0="schemas-WordTest">
<xsl:template match="/">
<Fonction>
<Title>
<b>
<xsl:value-of select="w:wordDocument/w:body/wx:sect/ns0:Fonction/w:p/ns0:Title/w:r/w:t"/>
</b>
</Title>
<SousTitre>
<xsl:value-of select="w:wordDocument/w:body/wx:sect/ns0:Fonction/w:p/ns0:SousTitre/w:r/w:t"/>
</SousTitre>
<Texte>
<xsl:value-of select="w:wordDocument/w:body/wx:sect/ns0:Fonction/w:p/ns0:Texte/w:r/w:t"/>
</Texte>
</Fonction>
</xsl:template>
</xsl:stylesheet>

Hope this helps,
Minollo

Postnext
zeinah KSubject: From WordML to XML
Author: zeinah K
Date: 11 Apr 2005 02:15 AM
Sorry , i didnt make myself clear enough.
What i want to do, is to keep the <Fonction>,<Subtitle>,<Texte> tags and also the word formatting tags like <b>,<i>,<u> which a user can optionally choose.
For example, within the <Texte> and </Texte> tags, the user will insert some text and will include some formatting to different words.
Is it possible to achieve this?
Thanks
Zeinah

Postnext
Minollo I.Subject: From WordML to XML
Author: Minollo I.
Date: 11 Apr 2005 08:35 AM
You can copy the whole sub-tree of an XML node using xsl:copy-of; that will copy any text formatting element too.
So, you can adapt the XSLT I mentioned earlier to use <xsl:copy-of.../> rather than <xsl:value-of.../>

Hope this helps,
Minollo

Postnext
zeinah KSubject: From WordML to XML
Author: zeinah K
Date: 12 Apr 2005 01:16 AM
Hello,
Thanks this brings me nearer to my desired solution.
Suppose i put the subtitle in bold, now i have this output

<SousTitre>
<w:t xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">My Subtitle</w:t>
</SousTitre>

Is it possible to have this output instead

<SousTitre>
<b>My Subtitle</b>
</SousTitre>

is there some kind of mapping which can be done?
Thanks
Zeinah

Posttop
d pSubject: From WordML to XML
Author: d p
Date: 17 Apr 2005 07:20 AM
Originally Posted: 17 Apr 2005 07:18 AM
hi,<br> I have been working on a similar project getting xml from word (2003) and here is the process i went through<br> <br> * download and install the word 2003 xml toolbar (this requires .net programability support enabled in the office 2003 installation)<br> * develop a schema for your document<br> * add the schema to the scheam library for the document<br> * use the xml toolbar to markup your content with xml tags that are based on the schema document.<br> * export as xml (sometimes you may have to say save as data only and not validate against the shcema as for some reason MS doesnt like particular schemas even thought they are valid and well formed)<br> <br> sounds simple? yeah.... thats what their video said but I found it a lot more difficult than that.<br> <br> drop me a line if you want more specifics.<br> <br> hope this helps<br> <br> -david

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

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