556 questions
0
votes
0
answers
33
views
DOMParser: TypeError: Converting circular structure to JSON
const xmlData = response.data // from axios;
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xmlData, "text/xml");
The parsing step creates such error: ...
4
votes
2
answers
193
views
How to extract text from between any given pair of spans?
I am trying to use Cheerio and Node.js to extract text from an interesting bit of HTML.
Let's say I have the following HTML:
<p>
<span class="sectionno" id="s1">1</...
0
votes
0
answers
62
views
Change in the way textContent returns text with carriage return in DOMParser in Chromium
Recently I noticed a change in the way DOMParser created XMLDocuments returned text with carriage returns in textContent. Namely, carriage returns are not longer being returned in textContent.
On the ...
1
vote
1
answer
137
views
DOMParser in an Extension Service Worker using the Offscreen document
I'm trying to switch my extension from MV2 to MV3 and I'm stuck on the DOMParser using the Offscreen document
Service_Worker :
*const OFFSCREEN_DOCUMENT_PATH = "/background/offscreen.html";
...
0
votes
0
answers
24
views
PHP Simple HTML DOM Parser not Returning Anything [duplicate]
I'm trying to use the PHP Simple HTML DOM Parser for the first time from here - https://simplehtmldom.sourceforge.io/docs/1.9/index.html
Unfortunately, I'm having an issue where it's not returning ...
-1
votes
1
answer
361
views
How to connect the domparser object in Googlescript?
I'm trying to parse a page in a Googlescript script in order to get a list of tables at
"https://stihi.ru/readers.html?vlassoff&start=0"
But the script gives an error
ReferenceError: ...
2
votes
1
answer
227
views
isPointInFIll does not work when programatically creating a SVG via DOMParser
I'm trying to programatically create a svg node like this
const parser = new DOMParser()
const doc = parser.parseFromString(mySvgAsString, 'image/svg+xml')
const svg = doc.children[0]
Everything ...
-2
votes
5
answers
103
views
How to perform this dynamic Find and replace in Javascript over user generated data?
I have an app that allows user to generate text with HTML code in the following format:
<h2>User generated Dynamic Data 1</h2>
<h3>User generated text 1.1</h3>
<h3&...
0
votes
1
answer
240
views
How to create/parse a data-structure from attribute names and values of a custom syntax markup-code?
I need to search for fields and values within a text and turn them into an object.
Example of text
// condition 1
<@if VERSION = "A1" || VERSION = "A3">
<@assign CTA = &...
1
vote
1
answer
74
views
Chromium xmlString -> DOMParser() -> XMLSerializer() Round Trip Failure with Embedded CDATA
If you take an XML String which has CDATA elements embedded within CDATA elements with the correct structure. (Where the embedded CDATA close of ']]' is represented as ']]]]>]]>"
And you ...
0
votes
1
answer
237
views
Null Result from XSLTProcessor.transformToFragment in JavaScript
I am experiencing an issue with transforming XML data using XSLT in JavaScript. My setup involves fetching XML data and an XSLT stylesheet, which is embedded within a tag in my HTML. When I try to ...
-1
votes
3
answers
434
views
How to create a Javascript array or object from an XML file?
I must first state that I am not a champion in programming, although created a handy website using html, php, MySQL and some javascript. Clearly, JS is by far the language I am almost using as a baby !...
1
vote
0
answers
36
views
How to replace specific words in plain HTML with <A>-links using cheerio?
I want to replace certain words or word groups with corresponding <a>-elements that link to specific sub-pages.
Let's say, I have the following text as my DIV-body:
The decentralized exchange ...
0
votes
0
answers
117
views
highcharts parseMarkup report a warning. This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
The warning is from method parseMarkup.
How to suppress the warning?
It seems an internal ...
-1
votes
1
answer
123
views
 in XML. What does it mean? How can I write it in XML?
In my sample xml I've got a tag like this.
<ISAPPLICABLE> Applicable</ISAPPLICABLE>
While I was trying to create an XML in java, I tried to hardcode this.
public void addElement(...
0
votes
1
answer
326
views
React Native get element when using querySelector from Web
In React Native i want to parse www.google.com and get its element that has a class class="lnXdpd".
I'm unsure how to use querySelector so once i fetch the url and have its string to parse ...
0
votes
4
answers
72
views
Regex match wrapped phrase with same delimiter (among many)
I need to parse the style attribute from an html corpus (contains many different html entries with many different style attribute).
An example of HTML may be the following :
<span style="font-...
0
votes
2
answers
412
views
Parsing xsl error- javax.xml.transform.TransformerException: use-character-maps attribute is not allowed on the xsl:output element
While parsing one of the XML files using XML Serializer in Java, the HTML entities are converted into their corresponding hex code values(like for mdash output is "hexcode value-#x2014;") ...
0
votes
1
answer
32
views
How to re order the tags in one XML file based on another XML file in java using dom parser
I have one XML file say source.xml
<students>
<student2>
<college>SIET</college>
<name>Rithvik</name>
</student2>
<student1>
&...
2
votes
2
answers
167
views
Extract relevant information for a Chrome extension
I am trying to build a chrome extension that aggregates information from a bunch of sites when the user visits a site A
async function fetchHTML(url) {
const response = await fetch(proxyUrl + url)...
7
votes
2
answers
1k
views
How can I parse HTML into a DOM tree, taking into account its origin location?
I am writing a user script that runs on https://example.net and makes fetch requests for HTML documents from https://example.com that I want to parse into HTML DOM trees.
The fetch API only gives me ...
0
votes
1
answer
419
views
Is it possible to use the DOMParser API when building a vscode exstension?
Hey i'm trying to use the DOMParser api inside a vscode extension that i'm making right now. vscode tells me it cant find the DOMParser instance and relevant methods when i try to use it. I managed to ...
1
vote
1
answer
558
views
DOMParser serializeToString HTML entities issue
I have some xml that I am trying to convert to xml document using DOMParser, make some changes and then convert back to xml string. But when I convert back to string using XMLSerializer, it changes &...
0
votes
1
answer
556
views
DOMParser.parseFromString returning different result in app and in test
I tried writing a unit test for one of our classes. It makes use of the DOMParser to access some XML attributes fetched from an endpoint.
The fetchXML part looks like this:
export async function ...
1
vote
0
answers
32
views
ArrayList partially overwrites stored values (but not all of them) when adding new object to the list (object variables aren´t static)
First of all English is not my first language, so sorry in advance for the mistakes.
The thing is I need some help understanding why I´m overwriting some values inside my array list.
I know this ...
0
votes
1
answer
209
views
Parsing the multilevel XML File with Java - Dom Parser
I have this xml file that contains 3 categories:employee_list, position_details and employee_info.
<?xml version="1.0" encoding="UTF-8"?>
<employee>
<...
0
votes
2
answers
377
views
How to clone or create a nested DOM node and change all its containing id values according to a current id?
I need to display some numbers, strings from a class named Student, but i can't figure it out how i can change the id from children element. I have to use JavaScript.
what i tried to do:
class Student{...
1
vote
0
answers
198
views
How to parsing rdf xml in Java
I used java dom to parsing rdf xml in java, but I couldn't parsing rdf xml in the direction I wanted. Here is my code :
String[] arr = new String[100];
DocumentBuilderFactory factory_parsing = ...
0
votes
5
answers
201
views
Skip adding class name to child element(s) if both parent and child element contains inline background-color
I am trying to add a random class name to elements that contains inline background color. I want to add one more condition to that. If parent and child elements both have inline background color, no ...
1
vote
1
answer
78
views
Iterate through HTML elements add a class name if it contains inline background-color
I have a user generated rich text content that needs to be modify with some additional static class names. I tried below JS code.
First I get the content and using DOMParser. Then iterate all elements,...
0
votes
1
answer
47
views
Is there any requirement for DOM used to create a DominoTree, such as being namespaceaware or created with level 2 dom builder?
We are adding code to convert a DOM to Domino before invoking saxon library to process xquery expression, which involves constructing a xml document as output.
Following exception is seen, for DOM ...
0
votes
1
answer
590
views
Type 'Node | null' is not assignable to type 'Node' when trying to iterate over HTML elements in TypeScript
I have some code takes a string of raw Markdown stored in 'markdownString' and converts it to HTML with the marked.js library for display on the web browser. I am trying to grab all plain text values ...
0
votes
1
answer
636
views
Manipulate the Object as result of DOM parser function
Im gonna rebuild my answer because the first time was a i mess;
im trying to do two things first one is to get the body from a html
with dom parse;
const stripHtml = function (html) {
const ...
5
votes
2
answers
545
views
<video> tag does not work in Safari when using DOMParser
When using DOMParser, <video> tag is not working in Safari, its preview is rendered but without controls and without the ability to play:
const parser = new DOMParser()
const parsed = parser....
0
votes
0
answers
79
views
How to replace a token only when it's used as a value not from attribute in html?
const app = document.getElementById("app");
const lessonText = `
<span style="font-family: "Courier New", Courier, monospace;">
<font color="#...
1
vote
4
answers
1k
views
Cypress click on link in mailhog body email
I need a help about testing mailhog with cypress.
I am trying to click on "Forgot password" link in email body, any advice how to do it?
0
votes
1
answer
561
views
Build html form from xml with JavaScript
I'm again asking for help....
Let's see, I've the next situation, I build a module for manage the clients in a web platform, when some order is gonna be created the user selects a client from a select ...
1
vote
2
answers
175
views
Make DOMParser use Standard mode instead of Quirks mode
Just realized that by default, DOMParser.parseFromString() creates documents in Quirks mode. Is there a way to make it Standard mode?
console.log(document.compatMode) // 'CSS1Compat'
const doc = ...
1
vote
3
answers
2k
views
How can I convert HTML to Object structure with text and formatting?
I need to convert a HTML String with nested Tags like this one:
const strHTML = "<p>Hello World</p><p>I am a text with <strong>bold</strong> word</p><p>&...
1
vote
1
answer
140
views
Within a markup-string, how to replace any e.g. class-name specified element with its own title-text?
I have a variable called $text.
I want to make it so that if there are any spans with the class "emote", replace the entire span and its contents with the title attribute of the span. Also, ...
-1
votes
2
answers
333
views
regex to get strings between content generated by ckeditor, for server-end
I am trying to get a regex that matches the strings between this output
<p>save</p>
<p>11<br />\nabc<br />\nabc<br />\nhello</p>\n\n<p>dfcs dcsd</p&...
0
votes
0
answers
25
views
Parsing an xml using javascript
This is running in IE browser.
This is my xml
<fields>
<from><type>string</type><value> India</value></from>
<number>&...
0
votes
3
answers
763
views
Java DOM Parser reading xml files information - nodes attributes
I have got an xml file and try to read in some information and try to arrange them.
The data in the xml looks like:
<Class code="1-10" kind="category">
<Meta ...
0
votes
1
answer
396
views
Xerces parser for UTF -8 Encoding
I have cpp code which is used to read xml files, parse data and then store it in table.
Initially data was ASCII encoded but now it is UTF8 encoded.
code is using Xerces c++ , can some help where it ...
-1
votes
1
answer
3k
views
Cannot read properties of undefined (reading 'childNodes')
I am trying to parse a text to a text/xml and get the value that is inside a child Node but is giving this error to me (Cannot read properties of undefined (reading 'childNodes').
I want the value ...
-1
votes
1
answer
100
views
Regular expression for finding all sub strings which are NOT inside a HTML link element
Assuming I have the following HTML snippet:
Deep Work
<p>
<a data-href="Deep Work" href="Deep Work" class="internal-link"
target="_blank" rel="...
0
votes
0
answers
245
views
page not found 404 error for dom-parser in node js
I am trying to parse a web page using dom-parser in nodejs. when i hit request through this, it shows 404 not found error but the page can be browsed using browser. here is my code.
var request = ...
1
vote
2
answers
246
views
how to copy data from one xml files in to another using java xslt
I need to replace all ? in file1.xml with element value present in File2.xml.
And also need to remove extra element node present in File1.xml whose value is not present in File2.xml. (i.e. In my ...
0
votes
0
answers
87
views
Why does the DOMParser cease to exist outside of this if statement? [duplicate]
I am using the DOMParser() to create a new Document Object Model from a remote webpage so that I can make an in-browser web scraper. This is the code that I have to retrieve the remote webpage.
...
0
votes
0
answers
328
views
DOMParser is not working in certain websites
I'm making a chrome extension.
I'm trying to get some pages' html through the javascript.
I found the code I can use in this site.
Here is the code:
fetch(url)
.then(function (response) { // When ...