xml-parse-from-string

WebJar for xml-parse-from-string

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

xml-parse-from-string
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

xml-parse-from-string
WebJar for xml-parse-from-string
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Jam3/xml-parse-from-string

Download xml-parse-from-string

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/xml-parse-from-string/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>xml-parse-from-string</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/xml-parse-from-string/
implementation 'org.webjars.npm:xml-parse-from-string:1.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/xml-parse-from-string/
implementation ("org.webjars.npm:xml-parse-from-string:1.0.1")
'org.webjars.npm:xml-parse-from-string:jar:1.0.1'
<dependency org="org.webjars.npm" name="xml-parse-from-string" rev="1.0.1">
  <artifact name="xml-parse-from-string" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='xml-parse-from-string', version='1.0.1')
)
libraryDependencies += "org.webjars.npm" % "xml-parse-from-string" % "1.0.1"
[org.webjars.npm/xml-parse-from-string "1.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

xml-parse-from-string

stable

A light browser wrapper around DOMParser.parseFromString for XML, with fallback for IE8 and other browsers.

  • attempts to use DOMParser with "application/xml"
  • falls back to ActiveXObject('Microsoft.XMLDOM')
  • then falls back to createElement / innerHTML
var parseXML = require('xml-parse-from-string')

var str = '<root><foobar id="blah"></foobar></root>'
var doc = parseXML(str)
var tag = doc.getElementsByTagName('foobar')[0]

console.log(tag.getAttribute('id')) // -> "blah"

Be wary of subtle differences between implementations, such as case-sensitivity in attribute.nodeName.

PRs for Node version welcome.

Usage

NPM

root = parse(str)

Parses the string as XML and returns the root element as a DOM element, so you can do operations similar to document.getElementById, document.getElementsByTagName, and so forth.

License

MIT, see LICENSE.md for details.

org.webjars.npm

Jam3

We create modern experiences for tomorrow’s brands

Versions

Version
1.0.1
1.0.0