Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make AvalonEdit xshd schema more flexible: allow elements and attribu…

…tes from other namespaces.
  • Loading branch information...
commit be2f73fa40f5a6f485bdce20af85e0c6846384f5 1 parent ed91c29
@dgrunwald dgrunwald authored
View
18 src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/ModeV2.xsd
@@ -14,7 +14,7 @@
<xsd:enumeration value="bold"/>
<xsd:enumeration value="normal"/>
<xsd:enumeration value="regular"/>
- <!-- should we support other font weigth names? -->
+ <!-- should we support other font weight names? -->
</xsd:restriction>
</xsd:simpleType>
</xsd:union>
@@ -35,6 +35,7 @@
<xsd:attribute name="background" type="xsd:string" use="optional" />
<xsd:attribute name="fontWeight" type="FontWeight" use="optional" />
<xsd:attribute name="fontStyle" type="FontStyle" use="optional" />
+ <xsd:anyAttribute namespace="##other" processContents="skip" />
</xsd:attributeGroup>
<xsd:attributeGroup name="ColorReferenceAttributes">
@@ -54,6 +55,7 @@
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="value" type="xsd:string" use="required" />
+ <xsd:anyAttribute namespace="##other" processContents="skip" />
</xsd:complexType>
</xsd:element>
@@ -76,7 +78,15 @@
</xsd:complexType>
</xsd:element>
- <xsd:element name="Word" type="xsd:string"/>
+ <xsd:element name="Word">
+ <xsd:complexType>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:anyAttribute namespace="##other" processContents="skip" />
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ </xsd:element>
<!-- Spans -->
<xsd:element name="Span">
@@ -132,9 +142,11 @@
<xsd:element ref="Span"/>
<xsd:element ref="Import"/>
<xsd:element ref="Rule"/>
+ <xsd:any namespace="##other" processContents="skip" />
</xsd:choice>
<xsd:attribute name="name" type="xsd:string" use="optional" />
<xsd:attribute name="ignoreCase" type="xsd:boolean" use="optional" />
+ <xsd:anyAttribute namespace="##other" processContents="skip" />
</xsd:complexType>
</xsd:element>
@@ -145,9 +157,11 @@
<xsd:element ref="Property"/>
<xsd:element ref="Color"/>
<xsd:element ref="RuleSet"/>
+ <xsd:any namespace="##other" processContents="skip" />
</xsd:choice>
<xsd:attribute name="name" type="xsd:string" use="optional" />
<xsd:attribute name="extensions" type="xsd:string" use="optional" />
+ <xsd:anyAttribute namespace="##other" processContents="skip" />
</xsd:complexType>
</xsd:element>
</xsd:schema>
View
5 src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Xshd/V2Loader.cs
@@ -60,6 +60,11 @@ static void ParseElements(ICollection<XshdElement> c, XmlReader reader)
return;
while (reader.Read() && reader.NodeType != XmlNodeType.EndElement) {
Debug.Assert(reader.NodeType == XmlNodeType.Element);
+ if (reader.NamespaceURI != Namespace) {
+ if (!reader.IsEmptyElement)
+ reader.Skip();
+ continue;
+ }
switch (reader.Name) {
case "RuleSet":
c.Add(ParseRuleSet(reader));
Please sign in to comment.
Something went wrong with that request. Please try again.