Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Problemi creazione sistema di verifica: come fare?

    Salve, sono un principiante, questa è la consegna di ciò che dovrei fare:
    Progettazione e realizzazione di un sistema di verifica automatica per documenti con struttura prefissata

    Il progetto ha lo scopo un sistema di controllo utilizzabile via Web per verificare che documenti in formato XML prodotti da Office 2003 abbiano un insieme di caratteristiche prefissate. I vincoli da verificare e i relativi messaggi d'errore dovranno essere gestibili da interfaccia Web e completamente configurabili.


    Secondo voi cosa mi conviene usare XSLT e poi Java, o solamente Java?

    Io dovrei verificare che durante il corpo del testo venga usato il font Times New Roman 12 con interlinea 1,5
    che vi sia un frontespizio (con nome, cognome),
    che vi sia un indice,
    un'introduzione
    e una bibliografia..

    Ossia devo creare un sistema di verifica per una tesi di laurea...

  2. #2
    Ciao,
    siccome il modello a cui i documenti XML dovranno aderire è prefissato,
    ossia sei in grado di creare un XSD con cui validarli,
    ti consiglio Java con l'uso delle librerie JAXB.

    Io le utilizzo per lavoro e mi trovo bene.
    inizialmente sono un po' macchinose ma danno grandi soddisfazioni.

    Qui puoi trovare un manualetto utile:
    http://mirkoagrati.110mb.com/downloads.php?dir=Java

    Altrimenti vai sul sito della SUN, le JAXB sono sue.

    Se ti servono delle informazioni su XSD e validazione di XML
    puoi dare un'occhiata qui:
    http://mirkoagrati.110mb.com/articol...SD.php&dir=XSD
    http://mirkoagrati.110mb.com/articol...ML.php&dir=XSD

    Sono articoli scritti da me.

    Buon Lavoro
    Mirko Agrati
    WEB : http://mirkoagrati.110mb.com
    RSS : http://feeds.feedburner.com/MirkoAgratiArticoli

  3. #3
    Scusa la mia più totale IGNORANZA, o meglio ho avuto vari suggerimenti e ora non riesco più a trovare il filo del discorso....

    Ti spiego con parole MIE quello che dovrei fare...
    Tramite un JFileCHooser dovrei poter prendere dal PC un file .xml (generato da Word 2003)
    e dopo che ho preso questo file che SORGE il mio più GRANDE dubbio e problema non avendo nessuna specifica di programmi da utilizzare....
    1) L'XML generato da Word 2003 non è propriamente una passeggiata e fra l'altro non trovo da nessuno parte qualche spiegazioni su come viene generato questo XML e che regole segue....
    2) Non capisco a cosa mi possa servire una DTD o comunque uno schema visto che il programma verrà utilizzato solo ed esclusivamente per delle TESI.xml e di cui io non posso modificare il contenuto del file .xml...ed in più non riesco a capire come creare schemi da un file del genere:
    ciao.xml (file xml creato scrivendo la sola parola ciao con word 2003)

    <?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-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-comfficeffice" 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" wcxPresent="no" xml:space="preserve">
    <w:ignoreElements w:val="http://schemas.microsoft.com/office/word/2003/wordml/sp2"/>
    <o: DocumentProperties>
    <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>
    <w wsp: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>

    3) Mi potresti spiegare in parole povere cosa dovrei fare secondo te passo a passo....
    (vorrei una spiegazione a parole spicciole)

    GRAZIE e scusami per il disturbo che ti sto arrecando!

  4. #4
    Dentro Office ho trovato questo file XML2WORD.XSL con questo codice:
    codice:
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet 
    	version="1.0"
    	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:xsl="http://www.w3.org/1999/XSL/Transform" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    	exclude-result-prefixes="xsi">
    	
    	<xsl:variable name="dxaIndent" select="'360'" />
    	<xsl:template match="/">
    		<xsl:variable name="currentSpacePreserve">
    			<xsl:value-of select="/*/@xml:space"/>
    		</xsl:variable>
    		<w:wordDocument>
    					<xsl:if test="$currentSpacePreserve != ''">
    						<xsl:attribute name="xml:space">
    							<xsl:value-of select="$currentSpacePreserve"/>
    						</xsl:attribute>
    					</xsl:if>
    			
    			<xsl:if test="processing-instruction()">
    				<o:CustomDocumentProperties>
    					<xsl:element name="o:processingInstructions">
    						<xsl:attribute name="dt:dt">string</xsl:attribute>
    						<xsl:apply-templates select="processing-instruction()" mode="piMode" />
    					</xsl:element>
    				</o:CustomDocumentProperties>
    			</xsl:if>
    			
    			<xsl:if test="//@xsi:schemaLocation">
    				<sl:schemaLibrary>
    					<xsl:for-each select="//@xsi:schemaLocation">
    						<xsl:call-template name="schemaLocationTransform">
    							<xsl:with-param name="schemaLocationString" select="." />
    						</xsl:call-template>
    					</xsl:for-each>
    				</sl:schemaLibrary>
    			</xsl:if>
    			
    			<w:docPr>
    				<w:view w:val="web" />
    				<w:removeWordSchemaOnSave w:val="on" />
    				<w:showXMLTags w:val="on" />
    			</w:docPr>
    			
    			
    			<w:body>
    				<xsl:apply-templates>
    					<xsl:with-param name="spacePreserve" select="$currentSpacePreserve"/>
    				</xsl:apply-templates>
    			</w:body>
    		</w:wordDocument>
    	</xsl:template>
    	<xsl:template match="*">
    		<xsl:param name="spacePreserve" select="default"/>
    		
    		<xsl:variable name="depth">
    			<xsl:choose>
    				<xsl:when test="count(ancestor::node()) * $dxaIndent >= 4320">
    					<xsl:value-of select="4320" />
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="$dxaIndent*count(ancestor::node()) - $dxaIndent" />
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    		<xsl:variable name="currentSpacePreserve">
    			<xsl:choose>
    				<xsl:when test="@xml:space">
    					<xsl:value-of select="@xml:space" />
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="$spacePreserve" />
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    		<xsl:copy>
    			<xsl:copy-of select="@*" />
    			<xsl:choose>
    				<xsl:when test="count(node())=0">
    					
    					<w:p>
    						<w:pPr>
    							<w:ind>
    								<xsl:attribute name="w:left">
    									<xsl:value-of select="$depth" />
    								</xsl:attribute>
    							</w:ind>
    						</w:pPr>
    					</w:p>
    				</xsl:when>
    				<xsl:when test="count(node())=1">
    					
    					<xsl:choose>
    						<xsl:when test="generate-id(child::node()[1])=generate-id(child::text()[1])">
    							
    							<xsl:apply-templates mode="leafNode">
    								<xsl:with-param name="spacePreserve" select="$currentSpacePreserve"/>
    							</xsl:apply-templates>
    						</xsl:when>
    						<xsl:otherwise>
    							
    							<w:p>
    								<w:pPr>
    									<w:ind>
    										<xsl:attribute name="w:left">
    											<xsl:value-of select="$depth" />
    										</xsl:attribute>
    									</w:ind>
    								</w:pPr>
    							</w:p>
    							<xsl:apply-templates>
    								<xsl:with-param name="spacePreserve" select="$currentSpacePreserve"/>
    							</xsl:apply-templates>
    							<w:p>
    								<w:pPr>
    									<w:ind>
    										<xsl:attribute name="w:left">
    											<xsl:value-of select="$depth" />
    										</xsl:attribute>
    									</w:ind>
    								</w:pPr>
    							</w:p>
    						</xsl:otherwise>
    					</xsl:choose>
    				</xsl:when>
    				<xsl:otherwise>
    					
    					<w:p>
    						<w:pPr>
    							<w:ind>
    								<xsl:attribute name="w:left">
    									<xsl:value-of select="$depth" />
    								</xsl:attribute>
    							</w:ind>
    						</w:pPr>
    					</w:p>
    					<xsl:apply-templates>
    						<xsl:with-param name="spacePreserve" select="$currentSpacePreserve"/>
    					</xsl:apply-templates>
    					<w:p>
    						<w:pPr>
    							<w:ind>
    								<xsl:attribute name="w:left">
    									<xsl:value-of select="$depth" />
    								</xsl:attribute>
    							</w:ind>
    						</w:pPr>
    					</w:p>
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:copy>
    	</xsl:template>
    	
    	<xsl:template match="w:* | v:* | w10:* | sl:* | aml:* | wx:* | o:* | dt:*">
    		<xsl:param name="spacePreserve" select="default"/>
    		<xsl:variable name="currentSpacePreserve">
    			<xsl:choose>
    				<xsl:when test="@xml:space">
    					<xsl:value-of select="@xml:space" />
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="$spacePreserve" />
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    		<xsl:apply-templates>
    			<xsl:with-param name="spacePreserve" select="$currentSpacePreserve"/>
    		</xsl:apply-templates>
    	</xsl:template>
    	
    	<xsl:template match="text()">
    		<xsl:param name="spacePreserve" select="default"/>
    		
    		<xsl:variable name="depth">
    			<xsl:choose>
    				<xsl:when test="count(ancestor::node()) * $dxaIndent >= 4320">
    					<xsl:value-of select="4320" />
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="$dxaIndent*count(ancestor::node())-$dxaIndent" />
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    		<xsl:variable name="currentSpacePreserve"><xsl:value-of select="$spacePreserve" /></xsl:variable>
    		
    		<w:p>
    			<w:pPr>
    				<w:ind>
    					<xsl:attribute name="w:left">
    						<xsl:value-of select="$depth" />
    					</xsl:attribute>
    				</w:ind>
    			</w:pPr>
    			<w:r>
    				<w:t>
    					<xsl:if test="$currentSpacePreserve != ''">
    						<xsl:attribute name="xml:space">
    							<xsl:value-of select="$currentSpacePreserve"/>
    						</xsl:attribute>
    					</xsl:if>
    					<xsl:value-of select="." />
    				</w:t>
    			</w:r>
    		</w:p>
    	</xsl:template>
    	<xsl:template match="text()" mode="leafNode">
    		<xsl:param name="spacePreserve" select="default"/>
    		
    		<xsl:variable name="depth">
    			<xsl:choose>
    				<xsl:when test="count(ancestor::node()) * dxaIndent >= 4320">
    					<xsl:value-of select="4320" />
    				</xsl:when>
    				<xsl:otherwise>
    					<xsl:value-of select="$dxaIndent*count(ancestor::node()) - $dxaIndent * 2" />
    				</xsl:otherwise>
    			</xsl:choose>
    		</xsl:variable>
    		<xsl:variable name="currentSpacePreserve"><xsl:value-of select="$spacePreserve" /></xsl:variable>
    		
    		<w:p>
    			<w:pPr>
    				<w:ind>
    					<xsl:attribute name="w:left">
    						<xsl:value-of select="$depth" />
    					</xsl:attribute>
    				</w:ind>
    			</w:pPr>
    			<w:r>
    				<w:t>
    					<xsl:if test="$currentSpacePreserve != ''">
    						<xsl:attribute name="xml:space">
    							<xsl:value-of select="$currentSpacePreserve"/>
    						</xsl:attribute>
    					</xsl:if>
    					<xsl:value-of select="." />
    				</w:t>
    			</w:r>
    		</w:p>
    	</xsl:template>
    	
    	<xsl:template match="processing-instruction()" mode="piMode">&lt;?<xsl:value-of select="local-name()" />&#160;<xsl:value-of select="." />?&gt;</xsl:template>
    	
    	<xsl:template name="schemaLocationTransform">
    		<xsl:param name="schemaLocationString" />
    		<xsl:variable name="schemaLocationStringNormalized">
    			<xsl:value-of select="normalize-space($schemaLocationString)" />
    		</xsl:variable>
    		<xsl:variable name="schemaLocationStringAfterURI">
    			<xsl:value-of select="substring-after($schemaLocationStringNormalized, ' ')" />
    		</xsl:variable>
    		<xsl:variable name="schemaLocationStringAfterLocation">
    			<xsl:value-of select="substring-after($schemaLocationStringAfterURI, ' ')" />
    		</xsl:variable>
    		<sl:schema>
    			<xsl:attribute name="sl:uri">
    				<xsl:value-of select="substring-before($schemaLocationStringNormalized, ' ')" />
    			</xsl:attribute>
    			<xsl:attribute name="sl:schemaLocation">
    				<xsl:if test="contains($schemaLocationStringAfterURI, ' ')">
    					<xsl:value-of select="substring-before($schemaLocationStringAfterURI, ' ')" />
    				</xsl:if>
    				<xsl:if test="not(contains($schemaLocationStringAfterURI, ' '))">
    					<xsl:value-of select="$schemaLocationStringAfterURI" />
    				</xsl:if>
    			</xsl:attribute>
    		</sl:schema>
    		<xsl:if test="contains($schemaLocationStringAfterLocation, ' ')">
    			<xsl:call-template name="schemaLocationTransform">
    				<xsl:with-param name="schemaLocationString" select="$schemaLocationStringAfterLocation" />
    			</xsl:call-template>
    		</xsl:if>
    	</xsl:template>
    </xsl:stylesheet>
    Questa mi sembra un trasformazione per cui io posso trasformare il mio file in .htm o txt....
    Potrebbe essermi utile?!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.