AnsweredAssumed Answered

XML and xmlns HELPP!!!

Question asked by maikeru on Feb 8, 2008

been working with this problem for days.  i'm doing a project invovling peer-to-peer communication and i need to pass the ip address of one client to another via XML. i don't have much idea about XML but i know for a fact that xmlns requires a URI.  My problem is that i have to create my own XML extension and i don't have any webserver running.  what I want is for the plugin to access the XML Schema (xsd) locally (stored in the computer).  What i did is i use file:// URI but I am not sure if it is working. Actually i don't know if the URI is wrong or my XML Schema is wrong. I am also trying to use a DTD as i know my XML Schema is missing some codes.

 

Here are my codes

 

 

 

 

 

 

 

DTD file contains:

 

 

 

<!ELEMENT camsession (camSessionID, hostIP)>

<!ELEMENT camSessionID (#CDATA)>

<!ELEMENT hostIP (#CDATA)>

 

 

 

XSD file contains:

 

 

 

<?xml version = "1.0" encoding="UTF-8"?>

<xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema"

elementFormDefault="qualified">

 

<xs:element name="camsession">

<xs:complexType>

<xs:sequence>

<xs:element name="camSessionID" type="xs:string"/>

<xs:element name="hostIP" type="xs:string"/>

</xs:sequence>

</xs:complexType>

</xs:element>

 

</xs:schema>

 

 

 

NOTE: the xsd file should actually include the following but since I am accessing the file locally i don't know what to put in between the quotes.

 

 

 

targetNamespace=" "

 

 

xmlns=" "

 

 

 

 

 

The NAMESPACE is returning this -> file:///C:/Documents%20and%20Settings/migs/Spark/plugins/plugintest/lib/xml/

 

 

 

 

 

 

 

The XML I am trying to pass is:

 

<iq id="WBrO4-30" to="ato@panther/spark" type="get">

  <camsession xmlns="file:///C:/Documents%20and%20Settings/migs/Spark/plugins/plugintest/lib/ xml/"> <camSessionID>2050651079</camSessionID> <hostIP>192.168.1.32</hostIP> </camsession> </iq>

 

 

 

 

 

 

 

Can anyone help me?

Outcomes