I am attempting to figure out why some text apparently doesn't have any carriage returns in it, even though it looks like it does. I am wondering if calling innerText when Xpath'ing through a XmlDocument (in .net 4.0) strips carriage returns or other characters. Probably not, But at this point I looking for anything.
InnerText when using XMLDocument removing carriage returns?
1.6k Views Asked by SoftwareSavant At
2
There are 2 best solutions below
0
Jon Hanna
On
What's the xml:space on the element? If you need to force it to be preserve whitespace other than significant whitespace, then you can set PreserveWhitespace to true before calling Load or LoadXML.
Be cautions with this though as in most cases the person writing the XML will expect the normal XML rules for whitespace to be followed. Even worse, if you get a "works for me" by using the non-standard rules that PreserveWhitespace uses, there's no reason you should expect anyone else to parse it as you intend.
Related Questions in C#
- Passing arguments to main in C using Eclipse
- kernel module does not print packet info
- error C2016 (C requires that a struct or union has at least one member) and structs typedefs
- Drawing with ncurses, sockets and fork
- How to catch delay-import dll errors (missing dll or symbol) in MinGW(-w64)?
- Configured TTL for A record(s) backing CNAME records
- Allocating memory for pointers inside structures in functions
- Finding articulation point of undirected graph by DFS
- C first fgets() is being skipped while the second runs
- C std library don't appear to be linked in object file
- gcc static library compilation
- How to do a case-insensitive string comparison?
- C programming: Create and write 2D array of files as function
- How to read a file then store to array and then print?
- Function timeouts in C and thread
Related Questions in TEXT
- Delete the extra space after special character in all the lines of text file
- Apply gaussian filter on text
- text show and hide with button php/js
- Get text from a section of a pdf page with IcePdf
- load word file (.docx) in richtextbox
- Display a specific line in a text file - android/java
- how to change text direction to the right slide of switch in android?
- C language - Read specific data from text file
- Read text file from specific position and store in two arrays
- How to animate text
- Detect repetition in text string / copied text
- Use MATLAB's webread to login to website and extract text
- LWJGL Drawing colored text to the screen issue
- Hide part of text temporarily, show after user clicks certain element
- Reading text file in java using scanner
Related Questions in XPATH
- XQuery: Select a node in the context of a variable
- Extract value of a input hidden DOMXpath php
- There is no element matching XPath "//html" (Behat\Mink\Exception\DriverException)
- Xpath rule template is missing in SonarQube 5.1
- Xpath having elements with and without prefixes in java
- Traversing with XPath?
- Unable to locate element using cssSelector and xpath
- BaseX XQuery error: root(): no context value bound
- How to add spaces between nodes when using string() on a tree in XPath
- grabbing value from html by xpath in python
- Selenium stops running after click() function runs
- Unable to get images from a link
- Selenium Unable to Perform Operations on SVG Elements
- XSLT expression to check if HTML element exists
- How to eliminate certain elements when scraping?
Related Questions in INNERTEXT
- JS check if page/content NOT contains
- How to set "
" to XML Document in C#
- How to add new lines inside P tag from server side by passing message p.InnerText
- Parsing HTML Table <td></td> InnerText Strip Punctuation (Comma)
- vbscript how to capture URL from location box in Internet Explorer
- How to get the innerText from currently selected option in a webBrowser control
- Set InnerText to be locked and non-editable
- innerText vs outerText
- When to use "innerText" over "value" of an element preferrably, and vice versa? HTML, JS
- Scrape text from a complex DOM structure
- InnerText when using XMLDocument removing carriage returns?
- How to append content to querySelectorAll element with innerHTML/innerText?
- VBA "If...Then" for keyword found in HTMLtag Innertext
- Why is '[' seen as being part of the XmlElement name?
- Cross browser issue with inner text
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You haven't shown any code, so it's hard to know where the data came from. By default, insignificant whitespace is not preserved when loading an
XmlDocument. You might want to try settingXmlDocument.PreserveWhitespaceto true before loading.If that doesn't help, please post a short but complete program which demonstrates the problem.