Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple root elements, text in second root #246

Open
kenjiuno opened this issue Sep 21, 2019 · 0 comments
Open

Multiple root elements, text in second root #246

kenjiuno opened this issue Sep 21, 2019 · 0 comments

Comments

@kenjiuno
Copy link

sax-js can accept this:

<a></a>
<b></b>

But sax-js cannot accept this:

<a></a>
<b>X</b>
Error: Text data outside of root node.
Line: 1
Column: 4
Char: X
    at error (H:\Proj\xml-summary-cli\node_modules\sax\lib\sax.js:651:10)
    at strictFail (H:\Proj\xml-summary-cli\node_modules\sax\lib\sax.js:677:7)
    at SAXParser.write (H:\Proj\xml-summary-cli\node_modules\sax\lib\sax.js:1035:15)
    at SAXStream.write (H:\Proj\xml-summary-cli\node_modules\sax\lib\sax.js:239:18)
    at ReadStream.ondata (_stream_readable.js:693:20)
    at ReadStream.emit (events.js:197:13)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at ReadStream.Readable.push (_stream_readable.js:224:10)
    at fs.read (internal/fs/streams.js:183:12)

I want to parse that document.
Because Windows Update wsusscn2.cab contains such a multi-rooted XML document

~/wsusscn2/x/10000190:

<ExtendedProperties DefaultPropertiesLanguage="en" Handler="http://schemas.microsoft.com/msus/2002/12/UpdateHandlers/WindowsInstaller" MaxDownloadSize="475894" MinDownloadSize="0">
 <InstallationBehavior RebootBehavior="CanRequestReboot" />
 <UninstallationBehavior />
</ExtendedProperties>
<Files>
 <File Digest="2wKNw4a06wUuomQDSUv6LEKlLoA=" DigestAlgorithm="SHA1" FileName="convintl-sr-latn-cs.cab" Size="475894" Modified="2013-10-29T13:40:20Z" PatchingType="SelfContained">
  <AdditionalDigest Algorithm="SHA256">pR4dV0DWJ0T4bAZlBb5q+U81nY/pwaaaoc27UhpQIKw=</AdditionalDigest>
 </File>
</Files>
<HandlerSpecificData type="msp:WindowsInstaller">
 <MspData CommandLine="DISABLESRCPROMPT=1 LOCALCACHESRCRES=0 NOLOCALCACHEROLLBACK=1" UninstallCommandLine="DISABLESRCPROMPT=1 LOCALCACHESRCRES=0 NOLOCALCACHEROLLBACK=1" FullFilePatchCode="{a64c19ed-f339-42fc-8195-7d4570060f9a}" />
</HandlerSpecificData>
tuananh added a commit to tuananh/sax-parser that referenced this issue Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant