GeeCON Prague 2014*
The moose likes XML and Related Technologies and the fly likes Insert space in xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Insert space in xml" Watch "Insert space in xml" New topic
Author

Insert space in xml

pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 321

Hello,

I need to insert spaces in an xml file.

I used   ( didn't work meaning I was wroking on xml ) basically there is a tool in a suite of Novell so wanted to make sure.

Then I used somewhere in my doc and it printed &nbs p; (ignore space ).
So I thought of inserting spaces instead of &nbs p but it didn't insert any space.

I also tried out & # 160 ;" "& # x 160;" (ignore spaces) as per Google but no use.

Please advise.


Thanks,
Pramod
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Um, you load the XML document into your text editor, position the cursor appropriately, and press the space bar as many times as you need to.

Or would you like to explain why you think you are having a problem?
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 321

Hey Paul,

Really don't know why it's happening.

Could you tell me how you insert spaces in a xml document.

May be then I can figure out a possible way. I rarely work on these issues. I have heard about some kind of attribute called process which when kept to false does something. Need to Google it once.

Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4397
    
    8

As Paul said - to put spaces in an XML document, you just put spaces in the document. It's a text file. There's nothing magic about it. Which is why I suspect you're really trying to ask something else.

At a guess, you're trying to put spaces in the result of some process acting on the XML file. But without knowing what that process is we can't help you. Can you explain further?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

I expect this is one of those situations where:

(1) There is some kind of a problem somewhere.

(2) The poster has already decided that this problem occurred because of a lack of spaces in an XML document.

So instead of asking us about the problem, we get a question about spaces in an XML document which is quite likely not relevant to the actual problem. Is that you, Pramod? Did you do that?
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 321

Hi Paul & Matthew,

I'm not sure if I'm working on html or xml because the editor shows HTML but when I export the file it shows xml tags in it.

Perhaps, I should check with Novell to see what can be done.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Yes, anything which interprets text as HTML will follow the HTML rules for text. One of these rules is to reduce a sequence of spaces to a single space when displaying it.

But yeah, if you want to edit XML then you should be using either a smart XML editor or a dumb text editor. Don't use an HTML editor.
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 321

Hey Paul,

I got the solution few minutes before.
There was a tool in Novell's IDM which provided text formatting just like MS Word.

I'll try your advice on it. It did
reduce a sequence of spaces to a single space when displaying it.
as you said.

Thanks for your time on this issue.
Happy weekend.
 
GeeCON Prague 2014
 
subject: Insert space in xml