0

I'm trying to generate a xml file using ejs. I have a string containing a part of this XML, while the rest of it is generated directly in the ejs.

Is there a way to directly put my string into the xml, so that the string is considered like a part of the xml?

I tried adding my string "brutally" with <%=string%>, but it does not recognise most of the symbols; for example, < becomes &lt;

Thank you!

2 Answers 2

0

There is an answer to a very similar question here: https://stackoverflow.com/a/8125053/2494631

Essentially, use <%- %> instead of <%= %> to output unescaped XML/HTML.

Sign up to request clarification or add additional context in comments.

Comments

0

i used

replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&')

but, this might not be what your looking for.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.