@@ -566,24 +566,6 @@ var char = function (a){
566566 return String . fromCharCode ( a ) ;
567567}
568568
569- var defaultOptions = {
570- attributeNamePrefix : "@_" ,
571- attrNodeName : false ,
572- textNodeName : "#text" ,
573- ignoreAttributes : true ,
574- ignoreNameSpace : false ,
575- allowBooleanAttributes : false , //a tag can have attributes without any value
576- //ignoreRootElement : false,
577- parseNodeValue : true ,
578- parseAttributeValue : false ,
579- arrayMode : false ,
580- trimValues : true , //Trim string values of tag and attributes
581- decodeHTMLchar : false ,
582- cdataTagName : false ,
583- cdataPositionChar : "\\c"
584- //decodeStrict: false,
585- } ;
586-
587569const chars = {
588570 nilChar : char ( 254 ) ,
589571 missingChar : char ( 200 ) ,
@@ -698,20 +680,23 @@ function hasData(jObj){
698680 }
699681}
700682
683+ var defaultOptions = require ( "./x2j" ) . defaultOptions ;
701684var convert2nimn = function ( node , e_schema , options ) {
702685 options = Object . assign ( { } , defaultOptions , options ) ;
703686 return _e ( node , e_schema , options )
704687}
705688
706- //exports.convert2nimn = _e;
707689exports . convert2nimn = convert2nimn ;
708- } , { } ] , 4 :[ function ( require , module , exports ) {
690+ } , { "./x2j" : 7 } ] , 4 :[ function ( require , module , exports ) {
709691exports . parse = require ( "./x2j" ) . parse ;
710692exports . convertTonimn = require ( "../src/nimndata" ) . convert2nimn ;
711693exports . getTraversalObj = require ( "./x2j" ) . getTraversalObj ;
712694exports . convertToJson = require ( "./x2j" ) . convertToJson ;
713695exports . validate = require ( "./validator" ) . validate ;
714696exports . j2xParser = require ( "./j2x" ) ;
697+ exports . parse2Nimn = function ( xmlData , schema , options ) {
698+ return exports . convertTonimn ( exports . getTraversalObj ( xmlData , options ) , schema , options ) ;
699+ } ;
715700
716701} , { "../src/nimndata" :3 , "./j2x" :2 , "./validator" :6 , "./x2j" :7 } ] , 5 :[ function ( require , module , exports ) {
717702var getAllMatches = function ( string , regex ) {
@@ -1104,8 +1089,9 @@ var defaultOptions = {
11041089 //decodeStrict: false,
11051090} ;
11061091
1092+ exports . defaultOptions = defaultOptions ;
1093+
11071094var getTraversalObj = function ( xmlData , options ) {
1108- //options = buildOptions(options);
11091095 options = Object . assign ( { } , defaultOptions , options ) ;
11101096 //xmlData = xmlData.replace(/\r?\n/g, " ");//make it single line
11111097 xmlData = xmlData . replace ( / < ! - - [ \s \S ] * ?- - > / g, "" ) ; //Remove comments
0 commit comments