Hello all,
Sorry if that question has been already discussed here. I have not found it.
I am trying to insert a complete XML schema file into a topic.
First, Flare recognized it as native XML code and tries to parse it and I had the "Wrong XML declaration" message dialog appearing on the screen.
Then I was advised to use CDATA tag as described here: http://www.w3schools.com/xml/xml_cdata.asp
In this case, Flare does not parse the code, but all the formatting (indentation) is lost.
So what I get in the topic looks like the attachment pic below. I would like to keep the formatting and have Flare not parse the XML code. Any advice?
Insert \ paste XML code sample in topic w orig formatting?
Insert \ paste XML code sample in topic w orig formatting?
You do not have the required permissions to view the files attached to this post.
-
- Senior Propellus Maximus
- Posts: 2632
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Insert \ paste XML code sample in topic w orig formatting?
An ignorant newbie speaking here, there's something about <div> that you should look at (so I have read) but I have no idea what. That might give you a starting point though, so hope it's of some use.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Insert \ paste XML code sample in topic w orig formatting?
You could *try* enclosing it in <pre></pre> tags -- that typically causes an html parser not to ignore extra whitepace elements (by default html ignores any whitespace elements beyond a single space).ChoccieMuffin wrote:An ignorant newbie speaking here, there's something about <div> that you should look at (so I have read) but I have no idea what. That might give you a starting point though, so hope it's of some use.
Flare v6.1 | Capture 4.0.0
Re: Insert \ paste XML code sample in topic w orig formatting?
I would try using a pre tag.
1. Copy the text to the clipboard.
2. In Flare, select the pre style.
3. Select Paste, then choose Paste as inline text.
1. Copy the text to the clipboard.
2. In Flare, select the pre style.
3. Select Paste, then choose Paste as inline text.
Re: Insert \ paste XML code sample in topic w orig formatting?
OK,
so far I enclosed CDATA tag with the <pre> tag. Works fine.
perhaps anybody knows how to make the code highlighted? I mean, not code in general but this specific XML code. I am afraid it might be tricky\impossible to do.
so far I enclosed CDATA tag with the <pre> tag. Works fine.
perhaps anybody knows how to make the code highlighted? I mean, not code in general but this specific XML code. I am afraid it might be tricky\impossible to do.
You do not have the required permissions to view the files attached to this post.
Re: Insert \ paste XML code sample in topic w orig formatting?
There are ways to get XML syntax highlighting / coloring in html, but I'm not familiar with any. A quick google search turned up this, but I have no idea if it would work for you:
http://tohtml.com/xml/
If that doesn't work, you may be able to do some more searching (the google search I used was xml syntax highlighting in html) to find something that works.
http://tohtml.com/xml/
If that doesn't work, you may be able to do some more searching (the google search I used was xml syntax highlighting in html) to find something that works.
Flare v6.1 | Capture 4.0.0
Re: Insert \ paste XML code sample in topic w orig formatting?
If you mean manually, just highlight it as you would any other text; e.g. use span tags.daicehawk wrote:perhaps anybody knows how to make the code highlighted? I mean, not code in general but this specific XML code. I am afraid it might be tricky\impossible to do.
As Andrew mentioned, there are quite a few online tools that will highlight code.
-
- Propeller Head
- Posts: 49
- Joined: Mon Jun 02, 2008 9:12 am
- Contact:
Re: Insert \ paste XML code sample in topic w orig formatting?
I used this site and it worked really well ... I had to replace all the single quotes with double quotes in order for Flare to like it but after that (using NotePad++) it worked fine. You also have to add theAndrew wrote:There are ways to get XML syntax highlighting / coloring in html, but I'm not familiar with any. A quick google search turned up this, but I have no idea if it would work for you:
http://tohtml.com/xml/
If that doesn't work, you may be able to do some more searching (the google search I used was xml syntax highlighting in html) to find something that works.
Code: Select all
xml:space="preserve"
Thank you for your comments and help with my quandary ...
Jamey
Jamey
Re: Insert \ paste XML code sample in topic w orig formattin
Dave's post is correct, but maybe a bit too concise, to the point of being cryptic.Dave Lee wrote:I would try using a pre tag.
1. Copy the text to the clipboard.
2. In Flare, select the pre style.
3. Select Paste, then choose Paste as inline text.
The most complete explanation of this procedure that I have seen is in the following post from Nita Beck:
viewtopic.php?f=6&t=20603
In summary:
1. Start a new paragraph and style the paragraph with the <pre> style (listed at the bottom of the Style window). Contents pasted in the <pre> block (paragraph) should retain their formatting, including any spaces and line breaks.
2. Copy and paste the code into the <pre> block (paragraph). Flare will insert the code as a bunch of <p> blocks for no reason, but DON’T PANIC!
3. Immediately look for the little Paste icon that appears just below and to the right of the last block added. Click the icon to open a little drop-down menu, and select Paste Inline Text. All of the pasted code should now be within the <pre> block with the original formatting.
Moshe Davis
Jerusalem, Israel
Jerusalem, Israel
Re: Insert \ paste XML code sample in topic w orig formattin
I just posted a solution to the exact original problem, using a combination of <pre> and CDATA, in a different thread:
viewtopic.php?f=6&t=29397#p128600
viewtopic.php?f=6&t=29397#p128600
Moshe Davis
Jerusalem, Israel
Jerusalem, Israel