You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to use xmldom to parse an iOS plist file that I plan to use for localization purposes in my javascript app. My end result will concatenate key / value tuples from multiple source (plist) files so that I have one master language file for my javascript app. Here is an example of how these source plist files are formatted:
CancelTitle
Cancel
EmailLabel
Email
To do so, I am trying to build a grunt task that will read the source file(s) and interpret it(them) as xml. In my Gruntfile.js, I have this under the grunt.initConfig block:
Inside of of the task directory file, I have this code:
module.exports = function (grunt) {
var xmldom = require('xmldom'),
xpath = require('xpath'),
_ = require('lodash'),
ATTRIBUTE_NODE = 2;
grunt.registerMultiTask('translator', 'Updates values in XML files based on XPath queries', function () {
var options = this.options();
var sourceFile = options.sourceFile;
var src = grunt.file.read(sourceFile);
var domParser = new xmldom.DOMParser();
var doc = domParser.parseFromString(
src
,'text/xml');
var dictNode = xmlContent.getElementsByTagName('dict')[0];
console.log(dictNode);
...
I am in the beginning stages of this project now and I am just trying to read the source file and interpret it as xml. After running grunt translate, I am receiving this error in the console:
end tag name: string is not match the current start tagName:dict
@#[line:3225,col:43]
Nothing comes up when I google for the this string however, I was able to spend some time snooping in the source code and found this line inside the sax.js file on line 105:
if(config.tagName != tagName){
errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
}
Hi there,
I am attempting to use xmldom to parse an iOS plist file that I plan to use for localization purposes in my javascript app. My end result will concatenate key / value tuples from multiple source (plist) files so that I have one master language file for my javascript app. Here is an example of how these source plist files are formatted:
CancelTitle
Cancel
EmailLabel
Email
To do so, I am trying to build a grunt task that will read the source file(s) and interpret it(them) as xml. In my Gruntfile.js, I have this under the grunt.initConfig block:
Down below I register a task with this code:
Inside of of the task directory file, I have this code:
module.exports = function (grunt) {
I am in the beginning stages of this project now and I am just trying to read the source file and interpret it as xml. After running grunt translate, I am receiving this error in the console:
end tag name: string is not match the current start tagName:dict
@#[line:3225,col:43]
Nothing comes up when I google for the this string however, I was able to spend some time snooping in the source code and found this line inside the sax.js file on line 105:
if(config.tagName != tagName){
errorHandler.fatalError("end tag name: "+tagName+' is not match the current start tagName:'+config.tagName );
}
https://github.com/jindw/xmldom/blob/c033b1907c049ee10a9cc71133925480f03e7134/sax.js
I would be very grateful for any help you could provide on the matter.
All the best,
Ben
The text was updated successfully, but these errors were encountered: