Click here to Skip to main content
15,909,939 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionHow do you get XSL to just read any element? Pin
Red_Wizard_Shot_The_Food14-Jun-06 4:41
Red_Wizard_Shot_The_Food14-Jun-06 4:41 
AnswerRe: How do you get XSL to just read any element? Pin
Dustin Metzgar14-Jun-06 4:45
Dustin Metzgar14-Jun-06 4:45 
Questionremove a table with xsl Pin
Yustme14-Jun-06 4:13
Yustme14-Jun-06 4:13 
AnswerRe: remove a table with xsl Pin
Elina Blank14-Jun-06 4:38
sitebuilderElina Blank14-Jun-06 4:38 
GeneralRe: remove a table with xsl Pin
Yustme14-Jun-06 4:41
Yustme14-Jun-06 4:41 
GeneralRe: remove a table with xsl Pin
Elina Blank14-Jun-06 4:53
sitebuilderElina Blank14-Jun-06 4:53 
QuestionHow to validate one file using multiple schemas? Pin
Arve Bjørnerud14-Jun-06 1:58
Arve Bjørnerud14-Jun-06 1:58 
QuestionAlmost there! [modified] Pin
Arve Bjørnerud15-Jun-06 2:54
Arve Bjørnerud15-Jun-06 2:54 
Through trial and error i think i've almost solved this problem. But i still need some help.

This is my example xml file, which cannot be edited:
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<aaa><br />
  <bbb>Text</bbb><br />
    <ccc>123</ccc><br />
      <ddd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="xyz"><br />
        <eee>text2</eee><br />
        <ccc>text3</ccc><br />
  </ddd><br />
</aaa><br />


I've made two schemas, first 'aaa_schema.xsd':
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified"><br />
  <xs:element name="aaa"><br />
    <xs:complexType><br />
      <xs:sequence><br />
        <xs:element name="bbb" type="xs:string" /><br />
        <xs:element name="ccc" type="xs:int" /><br />
        <xs:any/><br />
      </xs:sequence><br />
    </xs:complexType><br />
  </xs:element><br />
</xs:schema><br />


and 'ddd_schema.xsd':
<br />
<?xml version="1.0" encoding="UTF-8"?><br />
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" attributeFormDefault="unqualified" xmlns="xyz" targetNamespace="xyz"><br />
  <xs:element name="ddd"   ><br />
    <xs:complexType  ><br />
      <xs:sequence ><br />
        <xs:element name="eee" type="xs:string"  /><br />
        <xs:element name="ccc" type="xs:string"   /><br />
      </xs:sequence><br />
    </xs:complexType><br />
  </xs:element><br />
</xs:schema><br />


What i've done is add a xs:any to the aaa_schema where the ddd element should be.

In the .NET code i've added this:
<br />
Dim arrSchema As XmlSchemaSet = New XmlSchemaSet()<br />
arrSchema.Add(Nothing, New XmlTextReader("C:\temp\aaa_schema.xsd"))<br />
arrSchema.Add("xyz", New XmlTextReader("C:\temp\ddd_schema.xsd"))<br />


But when i try to validate the file i get this message:
"The element 'ddd' in namespace 'xyz' has invalid child element 'eee' in namespace 'xyz'. List of possible elements expected: 'eee'."

What does this mean? I thought the scope of the xyz namespace in the ddd_schema file covered all the child elements, not just the ddd element?

If i edit eee and ccc in the XML file like this:
<br />
<eee xmlns="" >text2</eee><br />
<ccc xmlns="" >text3</ccc><br />

Then everything work, but in the real scenario can't change the XML file.

Anyone?





-- modified at 2:46 Friday 16th June, 2006
Questionknow the size of DOM Pin
myvisualcplusplus13-Jun-06 19:34
myvisualcplusplus13-Jun-06 19:34 
QuestionDiff functionality for xml Pin
anidarsha13-Jun-06 19:07
anidarsha13-Jun-06 19:07 
QuestionPassing XML Data To SQL Tables Using Classic ASP Pin
rowdykuttan13-Jun-06 7:42
rowdykuttan13-Jun-06 7:42 
QuestionRead xml file into dataset (without any xml schema) [modified] Pin
kishoregolla13-Jun-06 3:59
kishoregolla13-Jun-06 3:59 
QuestionXML Programming on Pocket PC Pin
bluehai9-Jun-06 22:40
bluehai9-Jun-06 22:40 
Questionsoap comunication Pin
joana.sa.couto9-Jun-06 3:51
joana.sa.couto9-Jun-06 3:51 
QuestionHow do i get XSL to read tags inside CDATA in an XML file and NOT parse them to &quot;lt&quot; or &quot;gt&quot;? [modified] Pin
Red_Wizard_Shot_The_Food9-Jun-06 2:50
Red_Wizard_Shot_The_Food9-Jun-06 2:50 
QuestionIE has lost XML parsing ability - pls help! Pin
Koushik Biswas7-Jun-06 8:36
Koushik Biswas7-Jun-06 8:36 
Questionto get the value by xml tag in java script (asp.net) Pin
md_hashmath7-Jun-06 6:53
md_hashmath7-Jun-06 6:53 
AnswerRe: to get the value by xml tag in java script (asp.net) Pin
Elina Blank14-Jun-06 4:55
sitebuilderElina Blank14-Jun-06 4:55 
GeneralRe: to get the value by xml tag in java script (asp.net) [modified] Pin
kishoregolla18-Jun-06 19:38
kishoregolla18-Jun-06 19:38 
GeneralRe: to get the value by xml tag in java script (asp.net) Pin
Elina Blank19-Jun-06 3:54
sitebuilderElina Blank19-Jun-06 3:54 
QuestionXML syntax for && Pin
For_IT7-Jun-06 2:15
For_IT7-Jun-06 2:15 
AnswerRe: XML syntax for && Pin
Michael Dunn7-Jun-06 3:01
sitebuilderMichael Dunn7-Jun-06 3:01 
QuestionChecking for valid XML file structure Pin
conrado76-Jun-06 3:38
conrado76-Jun-06 3:38 
AnswerRe: Checking for valid XML file structure Pin
Stephan Samuel6-Jun-06 3:43
Stephan Samuel6-Jun-06 3:43 
AnswerRe: Checking for valid XML file structure Pin
BoneSoft10-Jun-06 18:49
BoneSoft10-Jun-06 18:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.