Click here to Skip to main content
14,734,433 members
Home » Discussions » XML / XSL
   

XML / XSL

 
QuestionNETIQ Product Help needed. Pin
Member 1156144127-Mar-15 11:24
MemberMember 1156144127-Mar-15 11:24 
AnswerRe: NETIQ Product Help needed. Pin
Richard Andrew x6427-Mar-15 15:14
professionalRichard Andrew x6427-Mar-15 15:14 
AnswerRe: NETIQ Product Help needed. Pin
Abhipal Singh19-May-15 6:07
professionalAbhipal Singh19-May-15 6:07 
Questioncopying attribute from one node to other Pin
ramina sen9-Feb-15 1:10
Memberramina sen9-Feb-15 1:10 
QuestionXSL: how to properly reference to xml field? Pin
Maciej Los16-Nov-14 10:05
mveMaciej Los16-Nov-14 10:05 
AnswerRe: XSL: how to properly reference to xml field? Pin
Richard Deeming17-Nov-14 3:52
mveRichard Deeming17-Nov-14 3:52 
GeneralRe: XSL: how to properly reference to xml field? Pin
Maciej Los17-Nov-14 5:25
mveMaciej Los17-Nov-14 5:25 
QuestionHow to get behavior similar to the obsoleted XmlValidatingReader Pin
John Whitmire30-Oct-14 4:53
professionalJohn Whitmire30-Oct-14 4:53 
Finally tired of the "System.Xml.XmlValidatingReader is obsolete" message, I undertook to replace it with the recommended XmlReader. The obsolescence documentation from MS wasn't much help, but I did manage to create code that compiled, as follows:
string nameSpace = GetSchemaNamespace(_XmlDocumentStream);
XmlTextReader schemaReader = new XmlTextReader(_SchemaStream);
XmlSchemaSet xsc = new XmlSchemaSet();
xsc.Add(nameSpace, schemaReader);
XmlNameTable nt = new NameTable();
XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
XmlParserContext parserContext = new XmlParserContext(nt, nsmgr, null, XmlSpace.None);
XmlReaderSettings settings = new XmlReaderSettings();
settings.ValidationType = ValidationType.Schema;
settings.ValidationFlags |= XmlSchemaValidationFlags.ReportValidationWarnings;
settings.Schemas.Add(xsc);
settings.ValidationEventHandler += new ValidationEventHandler(ValidationEventHandler);
XmlReader reader = XmlReader.Create(_XmlDocumentStream, settings, parserContext);

And then I found these two things I don't understand:
1.  First, the Create failed because this attribute in the xsd wasn't defined.
<xs:attribute ref="xml:space"/>

There was no complaint over this from the obsolete class. From the error message, I assume that this line previously covered that definition:
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
What changed such that this is now a fatal error?

2.  I removed the references to the above attribute so I could get a reader created and ran our set of unit tests for this process. The next surprise was that the reader doesn't handle validation errors the same as before. (a) Undefined attributes used to be Warnings. Now they are Errors. So what is now considered a warning? (b) It used to continue on from errors, allowing us to compile a list of errors and warnings for the XML being validated. Now, it bails out after the first error and I never get more than one invocation of the ValidationEventHandler. The test case that used to yield 43 errors and 21 warnings now produces a single error (and the test therefore fails). Is there a way to get the former behavior back?

modified 6-Nov-14 13:12pm.

AnswerRe: How to get behavior similar to the obsoleted XmlValidatingReader Pin
Gerry Schmitz30-Oct-14 22:21
mveGerry Schmitz30-Oct-14 22:21 
GeneralRe: How to get behavior similar to the obsoleted XmlValidatingReader Pin
John Whitmire3-Nov-14 4:04
professionalJohn Whitmire3-Nov-14 4:04 
SuggestionRe: How to get behavior similar to the obsoleted XmlValidatingReader Pin
John Whitmire6-Nov-14 3:47
professionalJohn Whitmire6-Nov-14 3:47 
QuestionVB.NET creat new XML Pin
Dereak12-Oct-14 18:43
MemberDereak12-Oct-14 18:43 
AnswerRe: VB.NET creat new XML Pin
User 41802545-Aug-15 3:28
MemberUser 41802545-Aug-15 3:28 
QuestionWriting XML from Excel Using VBA Pin
gedkins@deltagl.com30-Sep-14 15:15
Membergedkins@deltagl.com30-Sep-14 15:15 
AnswerRe: Writing XML from Excel Using VBA Pin
Richard Deeming1-Oct-14 2:45
mveRichard Deeming1-Oct-14 2:45 
Questiondelimiter or tokenizer in xslt Pin
DanielSatheesh27-Aug-14 2:22
MemberDanielSatheesh27-Aug-14 2:22 
AnswerRe: delimiter or tokenizer in xslt Pin
George Jonsson14-Sep-14 0:55
professionalGeorge Jonsson14-Sep-14 0:55 
QuestionMultiple namespaces in xslt Pin
MaryJames7-May-14 23:00
MemberMaryJames7-May-14 23:00 
AnswerRe: Multiple namespaces in xslt Pin
Richard MacCutchan7-May-14 23:24
mveRichard MacCutchan7-May-14 23:24 
GeneralRe: Multiple namespaces in xslt Pin
MaryJames8-May-14 4:16
MemberMaryJames8-May-14 4:16 
GeneralRe: Multiple namespaces in xslt Pin
Richard MacCutchan8-May-14 4:19
mveRichard MacCutchan8-May-14 4:19 
QuestionUse XmlAttributeOverrides, but get an InvalidOperationException nevertheless Pin
Christian Treffler2-Apr-14 9:15
MemberChristian Treffler2-Apr-14 9:15 
AnswerRe: Use XmlAttributeOverrides, but get an InvalidOperationException nevertheless Pin
Bernhard Hiller2-Apr-14 22:24
MemberBernhard Hiller2-Apr-14 22:24 
GeneralRe: Use XmlAttributeOverrides, but get an InvalidOperationException nevertheless Pin
Christian Treffler3-Apr-14 5:03
MemberChristian Treffler3-Apr-14 5:03 
QuestionXpath selecting nodes based on multiple attributes Pin
joost.versteegen4-Dec-13 5:28
Memberjoost.versteegen4-Dec-13 5:28 

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.