We are developing some DevOps module which reads/parses/cleanup some markup files and other artifacts. There is no need of validations to be performed against existing.
As part of above, we are trying to read few existing vue.js templates which have attribute prefixes as just "colon". It is a valid syntax according to vue.js. Unfortunately, we are not able to load that markup using c#.
I have following markup, which is valid according to vue.js:
<div class="form-group">
<AppCodeDropDownList :activityCode="activity.ActivityCode"
:activitySubcode="activity.ActivitySubCode" :mode="mode"
v-on:activity-code-selection="onActivityCodeSelection"
v-on:activity-subcode-selection="onActivitySubCodeSelection">
</AppCodeDropDownList>
</div>
I used XML reader as following:
XmlReaderSettings xrs = new XmlReaderSettings();
xrs.CheckCharacters = false;
xrs.ConformanceLevel = ConformanceLevel.Document;
xrs.ValidationType = ValidationType.None;
xrs.DtdProcessing = DtdProcessing.Ignore;
xrs.IgnoreComments = true;
xrs.IgnoreProcessingInstructions = true;
xrs.IgnoreWhitespace = true;
using (var reader = XmlReader.Create(sourceFile, xrs))
{
while (reader.Read())...
It throws an error
Name cannot begin with the ':' character, hexadecimal value 0x3A'.
In simple terms, imagine that I would like to read the above markup, do some "process" on each of the nodes, and write back similar kind of markup to some other file.
Any suggestions?