Click here to Skip to main content
15,894,180 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: XML Pin
Member 1273144310-Sep-16 5:53
Member 1273144310-Sep-16 5:53 
GeneralRe: XML Pin
OriginalGriff10-Sep-16 6:11
mveOriginalGriff10-Sep-16 6:11 
GeneralRe: XML Pin
Member 1273144310-Sep-16 6:40
Member 1273144310-Sep-16 6:40 
GeneralRe: XML Pin
OriginalGriff10-Sep-16 7:23
mveOriginalGriff10-Sep-16 7:23 
QuestionHow to create XSD without repeating myself Pin
Mikael Sterley28-Apr-16 3:46
Mikael Sterley28-Apr-16 3:46 
AnswerRe: How to create XSD without repeating myself Pin
George Jonsson13-Jun-16 3:08
professionalGeorge Jonsson13-Jun-16 3:08 
AnswerRe: How to create XSD without repeating myself Pin
Bernhard Hiller5-Sep-16 21:08
Bernhard Hiller5-Sep-16 21:08 
Questiongenerating a unique value and adding it to a group of elements Pin
Drew Church27-Mar-16 14:11
Drew Church27-Mar-16 14:11 
AnswerRe: generating a unique value and adding it to a group of elements Pin
Jim Meadors27-Mar-16 18:29
Jim Meadors27-Mar-16 18:29 
GeneralRe: generating a unique value and adding it to a group of elements Pin
Drew Church28-Mar-16 2:07
Drew Church28-Mar-16 2:07 
GeneralRe: generating a unique value and adding it to a group of elements Pin
Jim Meadors28-Mar-16 19:44
Jim Meadors28-Mar-16 19:44 
GeneralRe: generating a unique value and adding it to a group of elements Pin
Drew Church29-Mar-16 3:26
Drew Church29-Mar-16 3:26 
GeneralRe: generating a unique value and adding it to a group of elements Pin
Jim Meadors29-Mar-16 19:12
Jim Meadors29-Mar-16 19:12 
Questiontheory xml . help me Pin
Member 1216400424-Nov-15 5:29
Member 1216400424-Nov-15 5:29 
AnswerRe: theory xml . help me Pin
George Jonsson4-Dec-15 20:45
professionalGeorge Jonsson4-Dec-15 20:45 
QuestionXML parsing error --> #10; Pin
NJdotnetdev14-Jul-15 2:23
NJdotnetdev14-Jul-15 2:23 
AnswerRe: XML parsing error --> #10; Pin
User 41802545-Aug-15 2:27
User 41802545-Aug-15 2:27 
QuestionNETIQ Product Help needed. Pin
Member 1156144127-Mar-15 10:24
Member 1156144127-Mar-15 10:24 
AnswerRe: NETIQ Product Help needed. Pin
Richard Andrew x6427-Mar-15 14:14
professionalRichard Andrew x6427-Mar-15 14:14 
AnswerRe: NETIQ Product Help needed. Pin
Abhipal Singh19-May-15 5:07
professionalAbhipal Singh19-May-15 5:07 
Questioncopying attribute from one node to other Pin
ramina sen9-Feb-15 0:10
ramina sen9-Feb-15 0:10 
QuestionXSL: how to properly reference to xml field? Pin
Maciej Los16-Nov-14 9:05
mveMaciej Los16-Nov-14 9:05 
AnswerRe: XSL: how to properly reference to xml field? Pin
Richard Deeming17-Nov-14 2:52
mveRichard Deeming17-Nov-14 2:52 
GeneralRe: XSL: how to properly reference to xml field? Pin
Maciej Los17-Nov-14 4:25
mveMaciej Los17-Nov-14 4:25 
QuestionHow to get behavior similar to the obsoleted XmlValidatingReader Pin
John Whitmire30-Oct-14 3:53
professionalJohn Whitmire30-Oct-14 3: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:
C#
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.
XML
<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:
XML
<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.

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.