Creo un file con scritto ciao e lo salvo "ciao.xml" con word 2003
Questo è il codice:
<w:wordDocument xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-comffice: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
="urn:schemas-microsoft-com
ffice
ffice" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:wsp="http://schemas.microsoft.com/office/word/2003/wordml/sp2" w:macrosPresent="no" w:embeddedObjPresent="no" w
cxPresent="no" xml:space="preserve">
<w:ignoreElements w:val="http://schemas.microsoft.com/office/word/2003/wordml/sp2"/>
<oocumentProperties>
<o:Title>ciao</o:Title>
<o:Author>Davide Venturi</o:Author>
<o:LastAuthor>Davide Venturi</o:LastAuthor>
<o:Revision>1</o:Revision>
<o:TotalTime>1</o:TotalTime>
<o:Created>2007-10-02T21:33:00Z</o:Created>
<o:LastSaved>2007-10-02T21:34:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>0</o:Words>
<o:Characters>4</o:Characters>
<o:Company>VD</o:Company>
<o:Lines>1</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>4</o:CharactersWithSpaces>
<o:Version>11.0000</o:Version>
</oocumentProperties>
<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="Normale">
<w:name w:val="Normal"/>
<wx:uiName wx:val="Normale"/>
<w:rPr>
<wx:font wx:val="Times New Roman"/>
<w:sz w:val="24"/>
<w:sz-cs w:val="24"/>
<w:lang w:val="IT" w:fareast="IT" w:bidi="AR-SA"/>
</w:rPr>
</w:style>
<w:style w:type="character" w:default="on" w:styleId="Carpredefinitoparagrafo">
<w:name w:val="Default Paragraph Font"/>
<wx:uiName wx:val="Car. predefinito paragrafo"/>
<w:semiHidden/>
</w:style>
<w:style w:type="table" w:default="on" w:styleId="Tabellanormale">
<w:name w:val="Normal Table"/>
<wx:uiName wx:val="Tabella normale"/>
<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="Nessunelenco">
<w:name w:val="No List"/>
<wx:uiName wx:val="Nessun elenco"/>
<w:semiHidden/>
</w:style>
</w:styles>
<w:docPr>
<w:view w:val="print"/>
<w:zoom w:val="best-fit" wercent="120"/>
<w:doNotEmbedSystemFonts/>
<w:attachedTemplate w:val=""/>
<w:defaultTabStop w:val="708"/>
<w:hyphenationZone w:val="283"/>
<w:characterSpacingControl w:val="DontCompress"/>
<wptimizeForBrowser/>
<w:validateAgainstSchema/>
<w:saveInvalidXML w:val="off"/>
<w:ignoreMixedContent w:val="off"/>
<w:alwaysShowPlaceholderText w:val="off"/>
<w:compat>
<w:dontAllowFieldEndSelect/>
<w:useWord2002TableStyleRules/>
</w:compat>
<wsp:rsids>
<wsp:rsidRoot wsp:val="005D5BE7"/>
<wsp:rsid wsp:val="005D5BE7"/>
</wsp:rsids>
</w:docPr>
<w:body>
<wx:sect>
<wwsp:rsidR="005D5BE7" wsp:rsidRDefault="005D5BE7">
<w:r>
<w:t>ciao</w:t>
</w:r>
</w>
<w:sectPr wsp:rsidR="005D5BE7">
<wgSz w:w="11906" w:h="16838"/>
<wgMar w:top="1417" w:right="1134" w:bottom="1134" w:left="1134" 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>
Con xslt faccio questo codice cercando di prendere solo il corpo chiamato w:body del mio XML, ma quando applica la trasformazione mi da ERRORE...dove sbaglio?!?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="//w:body">
corpo:
<xsl:value-of select="*"/>
</xsl:template>
</xsl:stylesheet>
Se cancello questa parte
</xsl:template>
<xsl:template match="//w:body">
corpo:
<xsl:value-of select="*"/>
</xsl:template>
funziona, ma mi prende tutto il testo, e a me non serve che prenda TUTTO il testo, ma solo quello contenuto nel corpo (body)...

ffice: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
ocumentProperties>
ercent="120"/>
Rispondi quotando