You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Newton Bitar <nb...@genius.org.br> on 2006/08/11 23:30:01 UTC

Xerces.

Hi everybody;

I am with a problem of the xerces for organizer attributes to create
xml.

Down follow description the problem.


////////////////
  <resource identifier="RES-1C35A364-0A0B-1F0E-16D8-27696D21F314"
type="webcontent" adlcp:scormtype="sco" href="index.html">
      <metadata>
        <schema>ADL SCORM</schema>
        <schemaversion>1.2</schemaversion>
        <adlcp:location>lom.xml</adlcp:location>
      </metadata>
      <file href="ai_ge_nome.JPG" />
    </resource>
  </resources>

///////////////////////////

The sequence attribute in the file.xml I want create is identifier -->
type --> adlcp:scormtype --> href .

When use the code down, the sequence return is adlcp:scormtype --> href
--> identifier --> type.

	//create the element <resources> <resource>

		dom.normalizeDocument();
		Element resourcesresource =
dom.createElement("resource");
		//Element resourcesresource =
dom.createElementNS(null,"resource");
		
	
resourcesresource.setAttribute("identifier",xml.getResourcesResourceIden
tifier());
	
resourcesresource.setAttribute("type",xml.getResourcesResourceType());

	
resourcesresource.setAttribute("adlcp:scormtype",xml.getResourcesResourc
eAdlcpscormtype());
	
resourcesresource.setAttribute("href",xml.getResourcesResourceHref());
		resources.appendChild(resourcesresource);

Please how I have resolve the problem.


Tanks.
		




                Newton Bitar 
                Genius Instituto de Tecnologia 
                nbitar@genius.org.br  
                Tel.: +55 (92) 3614-6508 
                www.genius.org.br 


**************************************************************************************************

Re: Xerces.

Posted by Klaus Malorny <Kl...@knipp.de>.
Newton Bitar wrote:
> Hi everybody;
> 
> I am with a problem of the xerces for organizer attributes to create xml.
> 
> Down follow description the problem.
> 

Hi Newton,

the order of the attributes is not part of the XML infoset, i.e. it is a 
syntactic issue like whether you use single or double quotes for your attribute 
values. You should never rely on the order. Any XML processing entity is free to 
change it.

Regards,

Klaus


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: Xerces.

Posted by ke...@us.ibm.com.
The bug here is in your expectations. Order of attributes is not
significant in XML, and no XML applications promises to preserve a specific
order.


______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
(http://www.ovff.org/pegasus/songs/threes-rev-11.html)