Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
4

Need to remove unwanted XML hidden space elements

New Here ,
Apr 30, 2024 Apr 30, 2024

Hi All,

 

This is the XML project. I need to compare the TOC and chapter headings. When we tried to compare, we have captured the paragraph contents using paragraph styles (  "chapterHeadings.push(currentParagraph.contents);"  ). 

 

It was captured the actual text with XML hidden space elements(before and after). Because of the hidden elements we couln't be able to compare the actual text. You can find the attached screenshots.

 

Could someone help me to clear the hidden space elements without untagging?

 

Thanks in Advance,

Ashrafali R

TOPICS
Scripting
309
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2024 Apr 30, 2024

Check what Unicode you'll get in the .contents and then use JS replace() to remove it.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2024 May 01, 2024

Hi Robert,

 

Thanks for the details. But we are unable to findout the Unicode. Please let us know the unicode for that element or can we get anyother ways to remove?

 

Thanks in advance,

Ashrafali R

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 02, 2024 May 02, 2024
LATEST

I'm not JS guy - but quick googling returned:

 

charCodeAt()

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines