PDA

Visualizza la versione completa : [ Java ] SaxException in file xml


Angelo1974
08-07-2004, 12:37
Ciao a tutti; ho questo file xml:



<?xml version="1.0" encoding="ISO-8859-1"?>
<Package xmlns="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:vx="http://www.an.danet.de/2002/XPDL-Extensions1.0"
xsi:schemaLocation="http://www.wfmc.org/2002/XPDL1.0 http://wfmc.org/standards/docs/TC-1025_schema_10_xpdl.xsd"
Id="Bootstrap" Name="Initial workflow processes">
<PackageHeader>
<XPDLVersion>0.09</XPDLVersion>
<Vendor>Danet GmbH, GS AN</Vendor>
<Created>Sat Aug 24 15:12:01 CEST 2002</Created>
</PackageHeader>

<Applications>
<Application Id="WebForm">
<Description>Processing of an activity using a web form.</Description>
<ExtendedAttributes>
<ExtendedAttribute Name="Implementation">
<vx:ToolAgent Class="de.danet.an.webform.Submitter"
Execution="SYNCHR">
<vx:Property Name="Form">
<wf:form-data xmlns:wf="http://www.an.danet.de/2002/WebForm">
<wf:layout>
<i xmlns="">Input fields[/i]
</wf:layout>
</wf:form-data>
</vx:Property>
</vx:ToolAgent>
</ExtendedAttribute>
</ExtendedAttributes>
</Application>

<Application Id="SendResponse">
<Description>Send a response message to a servlet</Description>
<FormalParameters>
<FormalParameter Id="channel" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
<FormalParameter Id="message" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
</FormalParameters>
<ExtendedAttributes>
<ExtendedAttribute Name="Implementation">
<vx:ToolAgent Class="de.danet.an.workflow.tools.chabacc.Sender"/>
</ExtendedAttribute>
</ExtendedAttributes>
</Application>

<Application Id="SendXMLResponse">
<Description>Send a response message to a servlet</Description>
<FormalParameters>
<FormalParameter Id="channel" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
<FormalParameter Id="message" Mode="IN">
<DataType>
<SchemaType/>
</DataType>
</FormalParameter>
</FormalParameters>
<ExtendedAttributes>
<ExtendedAttribute Name="Implementation">
<vx:ToolAgent Class="de.danet.an.workflow.tools.chabacc.Sender"
XMLParameterMode="USE_SAX"/>
</ExtendedAttribute>
</ExtendedAttributes>
</Application>

</Applications>

<WorkflowProcesses>


<WorkflowProcess Id="account_new" Name="Create Account">
<ProcessHeader>
<Created>01.09.2001</Created>
<Description>
This is a very simple example of a process that consists of
several steps.
</Description>
<Priority>1</Priority>
</ProcessHeader>
<DataFields>
<DataField Id="accountType" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>ec</InitialValue>
<Description>Data for process initialization</Description>
</DataField>
<DataField Id="accountAccess" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>mother sister fatherly brother wife</InitialValue>
<Description>Data for process initialization</Description>
</DataField>
<DataField Id="testData" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>relevant process test data</InitialValue>
<Description>Data for process initialization</Description>
</DataField>
<DataField Id="emailAddress" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>account@bank.com</InitialValue>
<Description>Address where to report account requests.</Description>
</DataField>
<DataField Id="status" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</DataField>

<DataField Id="recipient" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>customer@bank.com</InitialValue>
<Description/>
</DataField>
<DataField Id="message" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>Account created</InitialValue>
<Description/>
</DataField>
<DataField Id="sender" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>account@bank.com</InitialValue>
<Description/>
</DataField>
<DataField Id="packageTestData" IsArray="FALSE">
<DataType>
<BasicType Type="STRING"/>
</DataType>
<InitialValue>package relevant data</InitialValue>
</DataField>
</DataFields>
<Participants>
<Participant Id="grpAB" Name="Order Processing">
<ParticipantType Type="RESOURCE_SET" />
</Participant>
<Participant Id="currentUser" Name="Current User">
<ParticipantType Type="HUMAN" />
<ExtendedAttributes>
<ExtendedAttribute Name="resource-selection"
Value="!:currentUser"/>
</ExtendedAttributes>
</Participant>
</Participants>
<Applications>
<Application Id="WebFormPlus">
<Description>Processing of an activity using a web form.
</Description>
<FormalParameters>
<FormalParameter Id="accountType" Mode="INOUT">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
<FormalParameter Id="accessGrant" Mode="INOUT">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
<FormalParameter Id="emailAddress" Mode="INOUT">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
<FormalParameter Id="statusOut" Mode="OUT">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
</FormalParameters>
<ExtendedAttributes>
<ExtendedAttribute Name="Implementation">
<vx:ToolAgent Class="de.danet.an.webform.Submitter"
Execution="SYNCHR">
<vx:Property Name="Form">
<wf:form-data xmlns:wf="http://www.an.danet.de/2002/WebForm">
<wf:layout xmlns="http://www.w3.org/2002/08/xforms/cr">
<input ref="wf:argument[@name='firstname']">
<label>First name </label>
</input>
<input ref="wf:argument[@name='lastname']">
<label>Last name </label>
</input>
<input ref="wf:argument[@name='emailAddress']">
<label>Email </label>
</input>
<select1 ref="wf:argument[@name='country']">
<label>Country </label>
<choices>
<item>
<label>Germany</label>
<value>germany</value>
</item>
<item>
<label>USA</label>
<value>usa</value>
</item>
</choices>
</select1>
<select1 ref="wf:argument[@name='accountType']">
<label>Type </label>
<choices>
<item>
<label>Visa</label>
<value>visa</value>
</item>
<item>
<label>Mastercard</label>
<value>mastercard</value>
</item>
<item>
<label>EC</label>
<value>ec</value>
</item>
<item>
<label>Money card</label>
<value>moneycard</value>
</item>
</choices>
</select1>
<select ref="wf:argument[@name='accessGrant']">
<label>Access granted: </label>
<choices>
<item>
<label>Wife</label>
<value>wife</value>
</item>
<item>
<label>Husband</label>
<value>husband</value>
</item>
<item>
<label>Mother</label>
<value>mother</value>
</item>
<item>
<label>Father</label>
<value>father</value>
</item>
<item>
<label>brother</label>
<value>brother</value>
</item>
<item>
<label>Sister</label>
<value>sister</value>
</item>
</choices>
</select>
<secret ref="wf:argument[@name='password']">
<label>Password </label>
</secret>
<secret ref="wf:argument[@name='retypepassword']">
<label>Retype password </label>
</secret>
<textarea ref="wf:argument[@name='notice']">
<label>Notice </label>
</textarea>
</wf:layout>
</wf:form-data>
</vx:Property>
</vx:ToolAgent>
</ExtendedAttribute>
</ExtendedAttributes>
</Application>
<Application Id="processingForm">
<Description>Processing of an activity using a web form.
</Description>
<ExtendedAttributes>
<ExtendedAttribute Name="Implementation">
<vx:ToolAgent Class="de.danet.an.webform.Submitter"
Execution="SYNCHR">
<vx:Property Name="Form">
<wf:form-data xmlns:wf="http://www.an.danet.de/2002/WebForm">
<wf:layout>
<i xmlns="">Input fields[/i]
</wf:layout>
</wf:form-data>
</vx:Property>
</vx:ToolAgent>
</ExtendedAttribute>
</ExtendedAttributes>
</Application>
<Application Id="SendMail">
<Description>Send a mail
</Description>
<FormalParameters>
<FormalParameter Id="emailAddress" Mode="IN">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
<FormalParameter Id="statusOut" Mode="OUT">
<DataType>
<BasicType Type="STRING"/>
</DataType>
</FormalParameter>
</FormalParameters>


Quando la parso ottengo l'eccezione:


2004-07-08 09:56:59,969 INFO [STDOUT] [DefaultProcessDefinition,ERROR] Cannot read XPDL: The prefix "xsi" for attribute "xsi:schemaLocation" is not bound.
org.xml.sax.SAXParseException: The prefix "xsi" for attribute "xsi:schemaLocation" is not bound.
at org.apache.xerces.parsers.AbstractSAXParser.parse( AbstractSAXParser.java:1162)

Ma a me il file sembra ben fatto;qualcuno sa darmi una dritta? Grazie e ciao

Angelo1974
08-07-2004, 12:46
Ah... ovviamente il file non finisce come vi ho mostrato; esso č ben fatto solo che era troppo lungo; penso sia dovuto, l'errore, a livello di namespaces che si riferiscono ad url obsoleti... solo che non riesco a capire dove potrei re-indirizzarli.
Ciao :ciauz: :argo:

blinkago
08-07-2004, 18:44
Scusa.. x le mie conoscenze di XML non si puņ aperire un tag se non hai chiuso col ">" quello prima o sbaglo?



<Package xmlns="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:vx="http://www.an.danet.de/2002/XPDL-Extensions1.0"
xsi:schemaLocation="http://www.wfmc.org/2002/XPDL1.0 http://wfmc.org/standards/docs/TC-1...ema_10_xpdl.xsd (http://wfmc.org/standards/docs/TC-1025_schema_10_xpdl.xsd)"
Id="Bootstrap" Name="Initial workflow processes">


okkio alle distrazioni...

PS: e poi, perchč hai chiuso 2 volte <a>

keratox
09-07-2004, 09:05
xml DEVE essere WELL-FORMED

blinkago
09-07-2004, 13:30
Originariamente inviato da keratox
xml DEVE essere WELL-FORMED

era ovvio... E credo che Angelo lo sappia..

Angelo1974
10-07-2004, 10:58
Grazie a tutti; so che il documento deve essere ben formato; il problema č che sono partito da un esempio che mi hanno assicurato essere funzionante e non ho controllato il file; poi non ho notato l'errore... come si dice 4 occhi guardano meglio di 2; in questo caso erano 6


Originariamente inviato da keratox
xml DEVE essere WELL-FORMED

Lo so che xml deve essere ben formato.... cmq grazie delle risposte; vi terrņ aggiornati.
Ciao :argo: :ciauz: :ciauz: :ciauz:

Loading