Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Re: XML code formatting
Re: XML code formatting [message #207977] Sun, 03 February 2008 19:00 Go to next message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

Mansour wrote:
> Whenever I add the DOCTYPE declaration for any xml file I loose the
> ability to format the code with CTRL-SHIFT-F. I have googled for this
> but no luck. Can any one suggest something?

Do you have an example? I've also added the Eclipse Webtools project on
this reply as well.

Dave
Re: XML code formatting [message #207993 is a reply to message #207977] Sun, 03 February 2008 20:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mansour.own.net

Davide, any example will do it. You can try a docbook document or and
SVG file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.0">
<defs>

</defs>

<g>
</g>
</svg>


If you hit CTRL-SHIFT-F nothing will happen. Remove the DOCTYPE
declaration and try again.


David Carver wrote:
> Mansour wrote:
>> Whenever I add the DOCTYPE declaration for any xml file I loose the
>> ability to format the code with CTRL-SHIFT-F. I have googled for this
>> but no luck. Can any one suggest something?
>
> Do you have an example? I've also added the Eclipse Webtools project on
> this reply as well.
>
> Dave
>
Re: XML code formatting [message #208000 is a reply to message #207993] Sun, 03 February 2008 21:42 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2327
Registered: July 2009
Senior Member
Mansour wrote:
> Davide, any example will do it. You can try a docbook document or and
> SVG file:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
> <svg xmlns="http://www.w3.org/2000/svg" version="1.0">
> <defs>
>
> </defs>
>
> <g>
> </g>
> </svg>
>
>
> If you hit CTRL-SHIFT-F nothing will happen. Remove the DOCTYPE
> declaration and try again.

It's formatting regardless of the DOCTYPE's presence for me. Which
version of WTP are you using?

---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: XML code formatting [message #208022 is a reply to message #208000] Mon, 04 February 2008 03:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dcarver.starstandard.org

Nitin Dahyabhai wrote:
> Mansour wrote:
>> Davide, any example will do it. You can try a docbook document or and
>> SVG file:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
>> <svg xmlns="http://www.w3.org/2000/svg" version="1.0">
>> <defs>
>> </defs>
>> <g>
>> </g>
>> </svg>
>>
>>
>> If you hit CTRL-SHIFT-F nothing will happen. Remove the DOCTYPE
>> declaration and try again.
>
> It's formatting regardless of the DOCTYPE's presence for me. Which
> version of WTP are you using?


In Web Tools 2.0.1 it doesn't format, in Web Tools 3.0 it does format.
In 2.0.1 there is a null pointer exception tossed, if the error logs is
reviewed.

Dave
Re: XML code formatting [message #208028 is a reply to message #208000] Mon, 04 February 2008 03:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mansour.own.net

I am using WST 2.0.1.v200709110510

Eclipse Platform
Version: 3.3.1.1
Build id: M20071023-1652

WTP UI Plug-in 1.1.101.v200709122200

Linux gtk 32-bit



Nitin Dahyabhai wrote:
> Mansour wrote:
>> Davide, any example will do it. You can try a docbook document or and
>> SVG file:
>>
>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
>> <svg xmlns="http://www.w3.org/2000/svg" version="1.0">
>> <defs>
>> </defs>
>> <g>
>> </g>
>> </svg>
>>
>>
>> If you hit CTRL-SHIFT-F nothing will happen. Remove the DOCTYPE
>> declaration and try again.
>
> It's formatting regardless of the DOCTYPE's presence for me. Which
> version of WTP are you using?
>
> ---
> Nitin Dahyabhai
> Eclipse WTP Source Editing
> IBM Rational
Re: XML code formatting [message #208034 is a reply to message #208022] Mon, 04 February 2008 03:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mansour.own.net

Here's some more info:

eclipse.buildId=M20071023-1652
java.version=1.6.0_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Command-line arguments: -os linux -ws gtk -arch x86

============================================================ =======
java.lang.NullPointerException
at
org.eclipse.wst.xml.core.internal.provisional.format.Element NodeFormatter.formatStartTag(ElementNodeFormatter.java:395)
at
org.eclipse.wst.xml.core.internal.provisional.format.Element NodeFormatter.formatNode(ElementNodeFormatter.java:121)
at
org.eclipse.wst.xml.core.internal.provisional.format.NodeFor matter.format(NodeFormatter.java:75)
at
org.eclipse.wst.xml.core.internal.provisional.format.Documen tNodeFormatter.formatChildren(DocumentNodeFormatter.java:42)
at
org.eclipse.wst.xml.core.internal.provisional.format.Element NodeFormatter.formatNode(ElementNodeFormatter.java:132)
at
org.eclipse.wst.xml.core.internal.provisional.format.NodeFor matter.format(NodeFormatter.java:75)
at
org.eclipse.wst.xml.core.internal.provisional.format.Documen tNodeFormatter.formatChildren(DocumentNodeFormatter.java:42)
at
org.eclipse.wst.xml.core.internal.provisional.format.Element NodeFormatter.formatNode(ElementNodeFormatter.java:132)
at
org.eclipse.wst.xml.core.internal.provisional.format.NodeFor matter.format(NodeFormatter.java:75)
at
org.eclipse.wst.xml.core.internal.provisional.format.Documen tNodeFormatter.formatChildren(DocumentNodeFormatter.java:42)
at
org.eclipse.wst.xml.core.internal.provisional.format.Element NodeFormatter.formatNode(ElementNodeFormatter.java:132)
at
org.eclipse.wst.xml.core.internal.provisional.format.NodeFor matter.format(NodeFormatter.java:75)
at
org.eclipse.wst.xml.core.internal.provisional.format.Documen tNodeFormatter.formatChildren(DocumentNodeFormatter.java:42)
at
org.eclipse.wst.xml.core.internal.provisional.format.Element NodeFormatter.formatNode(ElementNodeFormatter.java:132)
at
org.eclipse.wst.xml.core.internal.provisional.format.NodeFor matter.format(NodeFormatter.java:75)
at
org.eclipse.wst.sse.core.internal.format.AbstractStructuredF ormatProcessor.formatNode(AbstractStructuredFormatProcessor. java:405)
at
org.eclipse.wst.sse.core.internal.format.AbstractStructuredF ormatProcessor.formatModel(AbstractStructuredFormatProcessor .java:346)
at
org.eclipse.wst.sse.core.internal.format.AbstractStructuredF ormatProcessor.formatDocument(AbstractStructuredFormatProces sor.java:167)
at
org.eclipse.wst.sse.ui.internal.format.StructuredFormattingS trategy.format(StructuredFormattingStrategy.java:58)
at
org.eclipse.jface.text.formatter.MultiPassContentFormatter.f ormatMaster(MultiPassContentFormatter.java:193)
at
org.eclipse.jface.text.formatter.MultiPassContentFormatter.f ormat(MultiPassContentFormatter.java:142)
at
org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOpera tion(StructuredTextViewer.java:454)
at
org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOper ationAction.java:131)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.texteditor.TextOperationAction.run(TextOperat ionAction.java:129)
at
org.eclipse.ui.texteditor.RetargetTextEditorAction.run(Retar getTextEditorAction.java:237)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)







David Carver wrote:
> Nitin Dahyabhai wrote:
>> Mansour wrote:
>>> Davide, any example will do it. You can try a docbook document or and
>>> SVG file:
>>>
>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>>> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
>>> <svg xmlns="http://www.w3.org/2000/svg" version="1.0">
>>> <defs>
>>> </defs>
>>> <g>
>>> </g>
>>> </svg>
>>>
>>>
>>> If you hit CTRL-SHIFT-F nothing will happen. Remove the DOCTYPE
>>> declaration and try again.
>>
>> It's formatting regardless of the DOCTYPE's presence for me. Which
>> version of WTP are you using?
>
>
> In Web Tools 2.0.1 it doesn't format, in Web Tools 3.0 it does format.
> In 2.0.1 there is a null pointer exception tossed, if the error logs is
> reviewed.
>
> Dave
Re: XML code formatting [message #208042 is a reply to message #208022] Mon, 04 February 2008 03:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mansour.own.net

David Carver wrote:
> Nitin Dahyabhai wrote:
>> Mansour wrote:
>>> Davide, any example will do it. You can try a docbook document or and
>>> SVG file:
>>>
>>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>>> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>>> "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
>>> <svg xmlns="http://www.w3.org/2000/svg" version="1.0">
>>> <defs>
>>> </defs>
>>> <g>
>>> </g>
>>> </svg>
>>>
>>>
>>> If you hit CTRL-SHIFT-F nothing will happen. Remove the DOCTYPE
>>> declaration and try again.
>>
>> It's formatting regardless of the DOCTYPE's presence for me. Which
>> version of WTP are you using?
>
>
> In Web Tools 2.0.1 it doesn't format, in Web Tools 3.0 it does format.
But it's formatting when there's no DOCTYPE !!

> In 2.0.1 there is a null pointer exception tossed, if the error logs is
> reviewed.

I sent you the log. I guess that's the same exception you are talking
about. What do I need to do to fix this?

>
> Dave
Re: XML code formatting [message #208088 is a reply to message #208042] Mon, 04 February 2008 16:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Mansour wrote:
> David Carver wrote:
>>
>> In Web Tools 2.0.1 it doesn't format, in Web Tools 3.0 it does format.
> But it's formatting when there's no DOCTYPE !!
>
>> In 2.0.1 there is a null pointer exception tossed, if the error logs
>> is reviewed.
>
> I sent you the log. I guess that's the same exception you are talking
> about. What do I need to do to fix this?

Can you upgrade to WTP 3.0 ?

Eric
Re: XML code formatting [message #208132 is a reply to message #208088] Mon, 04 February 2008 17:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mansour.own.net

Eric Rizzo wrote:
> Mansour wrote:
>> David Carver wrote:
>>>
>>> In Web Tools 2.0.1 it doesn't format, in Web Tools 3.0 it does format.
>> But it's formatting when there's no DOCTYPE !!
>>
>>> In 2.0.1 there is a null pointer exception tossed, if the error logs
>>> is reviewed.
>>
>> I sent you the log. I guess that's the same exception you are talking
>> about. What do I need to do to fix this?
>
> Can you upgrade to WTP 3.0 ?
I will if I know exactly how. I have added Callisto Discovery, and I
have previously WTP updates and Europa Discovery. I followed them and
installed and updated everything under WTP updates. I am still getting
the same error.



>
> Eric
Re: XML code formatting [message #208140 is a reply to message #208042] Mon, 04 February 2008 19:19 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2327
Registered: July 2009
Senior Member
Mansour wrote:
>> In 2.0.1 there is a null pointer exception tossed, if the error logs
>> is reviewed.
>
> I sent you the log. I guess that's the same exception you are talking
> about. What do I need to do to fix this?

From what I can tell it comes from an xml:space attribute
declaration in the referenced DTD (or another file it includes) not
having a default value given. If you open a bug with this stack
trace there's a chance it will be fixed in 2.0.2.


---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: XML code formatting [message #208188 is a reply to message #208140] Tue, 05 February 2008 16:27 Go to previous message
Eclipse UserFriend
Originally posted by: wuamy.ca.ibm.com

There's already a bug for this issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=196544

I was going to target it for 3.0 M5, but I can go ahead and target it to
2.0.2.
Previous Topic:about lomboz 3.3
Next Topic:ws-i compliance report
Goto Forum:
  


Current Time: Fri Nov 21 02:28:51 GMT 2014

Powered by FUDForum. Page generated in 0.02103 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software