Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-11 Thread Vimalanathan Rajeevan
Thanks Viraj and Kavith.

Thanks,
Rajeevan

On Sat, Jun 11, 2016 at 12:41 AM, Kavith Lokuhewage  wrote:

> Hi,
>
> On an additional note, this is a major drawback that we have with several
> components in DevStudio. While trying to improve artfact.xml and pom.xml
> handling components, we recently came across [1], which is based on the
> concept of non extractive parsing[2]. Unfortunately this is licensed with
> GPL2 hence we cannot distribute it Apache license. I could not find a
> similar library with a compatible license.
> So either we can implement a framework with a similar algorithm or we need
> to go for complex regex based text replacing - if we cannot find any
> alternative.
>
> Thanks,
>
> [1] http://vtd-xml.sourceforge.net/
> [2] http://www.xml.com/pub/a/2004/05/19/parsing.html
>
> *Kavith Lokuhewage*
> Senior Software Engineer
> WSO2 Inc. - http://wso2.com
> lean . enterprise . middleware
> Mobile - +94779145123
> Linkedin 
> Twitter 
>
> On Sat, Jun 11, 2016 at 10:57 AM, Viraj Rajaguru  wrote:
>
>> Hi Rajeevan,
>>
>> I think we have two issues.
>>
>> 1. The way attributes are ordered in generated source is not readable.
>> Eg: Property name should come before the Property expression.
>>
>> This is a valid requirement and we will try to fix in a future release.
>> (not in the next immediate release). We will need to find a correct XML
>> processing library as Nuwan & Susinda mentioned.
>>
>> 2. Changes done in source view such as formatting, commenting, ordering
>> of elements/attributes etc. will be overridden by switching between
>> graphical view and source view.
>>
>> This is a more critical issue which tends users to move from Graphical
>> editor to default XML editor. Currently we are regenerating the whole
>> source according to what we have in graphical view. This will lead to
>> override users's changes such as formatting, commenting. What we should do
>> is to modify the existing source in source view according to the changes we
>> have done is graphical view rather regenerating the whole source so that we
>> will not loose anything we've done in the source view.
>>
>> Thanks for pointing these issues and we will fix these in future releases.
>>
>> Thanks,
>> Viraj.
>>
>> On Sat, Jun 11, 2016 at 9:08 AM, Vimalanathan Rajeevan <
>> rajeev...@wso2.com> wrote:
>>
>>> Thanks Nuwan and Susinda for your prompt responses.
>>>
>>> I would say it is a nice to have thing rather not a blocker for
>>> Developer Studio. Here the issue is user can not keep desired attribute
>>> order when using Graphical Editor(when switching between Design and Source
>>> view it is getting overwritten). IMO, even though attribute order does not
>>> matter in XML programming it is important for better readability as I
>>> explained above. I have seen some users are using Eclipse default XML
>>> editor for programming because of this kind of issues with Graphical
>>> Editor. But I understand the difficulty of fixing this issue with available
>>> XML processing libraries. So if possible we can give a try to fix this[1].
>>> WDYT?
>>>
>>> [1] https://wso2.org/jira/browse/DEVTOOLESB-374
>>>
>>> Thanks,
>>> Rajeevan
>>>
>>> On Fri, Jun 10, 2016 at 1:00 AM, Susinda Perera 
>>> wrote:
>>>
 Hi Rajeevan

 I have google a bit on this issue in general. It seems like normal DOM
 does not care about the attribute order. Also I believe xml schemas would
 also not care about the order[1]. We have to test this whether we have any
 support in axiom level. As this requirement is valid in terms of end user,
 please create a JIRA to track this. Kavith is looking at some other xml
 processing library, may be he can hive some input.

 [1] - https://www.w3.org/TR/REC-xml/#sec-starttags

 On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan <
 rajeev...@wso2.com> wrote:

> Hi,
>
> I will explain the issue with the help of Property Mediator. When we
> are adding a property with an expression to a sequence in Graphical 
> Editor,
> the source view for that mediator is as follows,
>
>    name="TestProperty" xmlns:m0="http://services.samples;
> xmlns:m1=" http://services.samples/xsd "/>
>
> Here 'expression' is positioned before 'name' of the mediator. IMHO,
> 'name' should be positioned before 'expression'(for better readability) 
> and
> we should try to keep the order as below(from ESB Doc),
>
>  "literal" | expression="xpath") 
> [scope=default|transport|axis2|axis2-client]
> [pattern="regex" [group="integer"]]>
> ?
> 
>
> So I tried to change it from source view but when I switching between
> graphical and source views my changes are removed and ordered by
> alphabetically. It is giving difficulties when we are using 

Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Kavith Lokuhewage
Hi,

On an additional note, this is a major drawback that we have with several
components in DevStudio. While trying to improve artfact.xml and pom.xml
handling components, we recently came across [1], which is based on the
concept of non extractive parsing[2]. Unfortunately this is licensed with
GPL2 hence we cannot distribute it Apache license. I could not find a
similar library with a compatible license.
So either we can implement a framework with a similar algorithm or we need
to go for complex regex based text replacing - if we cannot find any
alternative.

Thanks,

[1] http://vtd-xml.sourceforge.net/
[2] http://www.xml.com/pub/a/2004/05/19/parsing.html

*Kavith Lokuhewage*
Senior Software Engineer
WSO2 Inc. - http://wso2.com
lean . enterprise . middleware
Mobile - +94779145123
Linkedin   Twitter


On Sat, Jun 11, 2016 at 10:57 AM, Viraj Rajaguru  wrote:

> Hi Rajeevan,
>
> I think we have two issues.
>
> 1. The way attributes are ordered in generated source is not readable. Eg:
> Property name should come before the Property expression.
>
> This is a valid requirement and we will try to fix in a future release.
> (not in the next immediate release). We will need to find a correct XML
> processing library as Nuwan & Susinda mentioned.
>
> 2. Changes done in source view such as formatting, commenting, ordering of
> elements/attributes etc. will be overridden by switching between graphical
> view and source view.
>
> This is a more critical issue which tends users to move from Graphical
> editor to default XML editor. Currently we are regenerating the whole
> source according to what we have in graphical view. This will lead to
> override users's changes such as formatting, commenting. What we should do
> is to modify the existing source in source view according to the changes we
> have done is graphical view rather regenerating the whole source so that we
> will not loose anything we've done in the source view.
>
> Thanks for pointing these issues and we will fix these in future releases.
>
> Thanks,
> Viraj.
>
> On Sat, Jun 11, 2016 at 9:08 AM, Vimalanathan Rajeevan  > wrote:
>
>> Thanks Nuwan and Susinda for your prompt responses.
>>
>> I would say it is a nice to have thing rather not a blocker for Developer
>> Studio. Here the issue is user can not keep desired attribute order when
>> using Graphical Editor(when switching between Design and Source view it is
>> getting overwritten). IMO, even though attribute order does not matter in
>> XML programming it is important for better readability as I explained
>> above. I have seen some users are using Eclipse default XML editor for
>> programming because of this kind of issues with Graphical Editor. But I
>> understand the difficulty of fixing this issue with available XML
>> processing libraries. So if possible we can give a try to fix this[1]. WDYT?
>>
>> [1] https://wso2.org/jira/browse/DEVTOOLESB-374
>>
>> Thanks,
>> Rajeevan
>>
>> On Fri, Jun 10, 2016 at 1:00 AM, Susinda Perera  wrote:
>>
>>> Hi Rajeevan
>>>
>>> I have google a bit on this issue in general. It seems like normal DOM
>>> does not care about the attribute order. Also I believe xml schemas would
>>> also not care about the order[1]. We have to test this whether we have any
>>> support in axiom level. As this requirement is valid in terms of end user,
>>> please create a JIRA to track this. Kavith is looking at some other xml
>>> processing library, may be he can hive some input.
>>>
>>> [1] - https://www.w3.org/TR/REC-xml/#sec-starttags
>>>
>>> On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan <
>>> rajeev...@wso2.com> wrote:
>>>
 Hi,

 I will explain the issue with the help of Property Mediator. When we
 are adding a property with an expression to a sequence in Graphical Editor,
 the source view for that mediator is as follows,

 >>>   name="TestProperty" xmlns:m0="http://services.samples;
 xmlns:m1=" http://services.samples/xsd "/>

 Here 'expression' is positioned before 'name' of the mediator. IMHO,
 'name' should be positioned before 'expression'(for better readability) and
 we should try to keep the order as below(from ESB Doc),

 >>> "literal" | expression="xpath") 
 [scope=default|transport|axis2|axis2-client]
 [pattern="regex" [group="integer"]]>
 ?
 

 So I tried to change it from source view but when I switching between
 graphical and source views my changes are removed and ordered by
 alphabetically. It is giving difficulties when we are using Graphical
 Editor and trying to keep some conventions.
 It should be a known issue. Will we be able to fix this?

 Appreciate your thoughts on this.

 --
 Vimalanathan Rajeevan
 Software Engineer,
 WSO2, Inc. *http://wso2.com* 

Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Viraj Rajaguru
Hi Rajeevan,

I think we have two issues.

1. The way attributes are ordered in generated source is not readable. Eg:
Property name should come before the Property expression.

This is a valid requirement and we will try to fix in a future release.
(not in the next immediate release). We will need to find a correct XML
processing library as Nuwan & Susinda mentioned.

2. Changes done in source view such as formatting, commenting, ordering of
elements/attributes etc. will be overridden by switching between graphical
view and source view.

This is a more critical issue which tends users to move from Graphical
editor to default XML editor. Currently we are regenerating the whole
source according to what we have in graphical view. This will lead to
override users's changes such as formatting, commenting. What we should do
is to modify the existing source in source view according to the changes we
have done is graphical view rather regenerating the whole source so that we
will not loose anything we've done in the source view.

Thanks for pointing these issues and we will fix these in future releases.

Thanks,
Viraj.

On Sat, Jun 11, 2016 at 9:08 AM, Vimalanathan Rajeevan 
wrote:

> Thanks Nuwan and Susinda for your prompt responses.
>
> I would say it is a nice to have thing rather not a blocker for Developer
> Studio. Here the issue is user can not keep desired attribute order when
> using Graphical Editor(when switching between Design and Source view it is
> getting overwritten). IMO, even though attribute order does not matter in
> XML programming it is important for better readability as I explained
> above. I have seen some users are using Eclipse default XML editor for
> programming because of this kind of issues with Graphical Editor. But I
> understand the difficulty of fixing this issue with available XML
> processing libraries. So if possible we can give a try to fix this[1]. WDYT?
>
> [1] https://wso2.org/jira/browse/DEVTOOLESB-374
>
> Thanks,
> Rajeevan
>
> On Fri, Jun 10, 2016 at 1:00 AM, Susinda Perera  wrote:
>
>> Hi Rajeevan
>>
>> I have google a bit on this issue in general. It seems like normal DOM
>> does not care about the attribute order. Also I believe xml schemas would
>> also not care about the order[1]. We have to test this whether we have any
>> support in axiom level. As this requirement is valid in terms of end user,
>> please create a JIRA to track this. Kavith is looking at some other xml
>> processing library, may be he can hive some input.
>>
>> [1] - https://www.w3.org/TR/REC-xml/#sec-starttags
>>
>> On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan <
>> rajeev...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I will explain the issue with the help of Property Mediator. When we are
>>> adding a property with an expression to a sequence in Graphical Editor, the
>>> source view for that mediator is as follows,
>>>
>>> >>   name="TestProperty" xmlns:m0="http://services.samples;
>>> xmlns:m1=" http://services.samples/xsd "/>
>>>
>>> Here 'expression' is positioned before 'name' of the mediator. IMHO,
>>> 'name' should be positioned before 'expression'(for better readability) and
>>> we should try to keep the order as below(from ESB Doc),
>>>
>>> >> "literal" | expression="xpath") [scope=default|transport|axis2|axis2-client]
>>> [pattern="regex" [group="integer"]]>
>>> ?
>>> 
>>>
>>> So I tried to change it from source view but when I switching between
>>> graphical and source views my changes are removed and ordered by
>>> alphabetically. It is giving difficulties when we are using Graphical
>>> Editor and trying to keep some conventions.
>>> It should be a known issue. Will we be able to fix this?
>>>
>>> Appreciate your thoughts on this.
>>>
>>> --
>>> Vimalanathan Rajeevan
>>> Software Engineer,
>>> WSO2, Inc. *http://wso2.com* 
>>> Lean.Enterprise.Middleware
>>>
>>> Mobile:
>>> *+94 773090875 <%2B94%20773090875>*
>>> LinkedIn:
>>> *https://www.linkedin.com/in/RajeevanVimalanathan
>>> *
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Susinda Perera*
>> Software Engineer
>> B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL)
>> Mobile:(+94)716049075
>> Blog: susinda.blogspot.com
>> WSO2 Inc. http://wso2.com/
>> Tel : 94 11 214 5345 Fax :94 11 2145300
>>
>>
>
>
> --
> Vimalanathan Rajeevan
> Software Engineer,
> WSO2, Inc. *http://wso2.com* 
> Lean.Enterprise.Middleware
>
> Mobile:
> *+94 773090875 <%2B94%20773090875>*
> LinkedIn:
> *https://www.linkedin.com/in/RajeevanVimalanathan
> *
>



-- 
Viraj Rajaguru
Associate Technical Lead
WSO2 Inc. : http://wso2.com

Mobile: +94 77 3683068
___
Dev mailing list
Dev@wso2.org

Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Vimalanathan Rajeevan
Thanks Nuwan and Susinda for your prompt responses.

I would say it is a nice to have thing rather not a blocker for Developer
Studio. Here the issue is user can not keep desired attribute order when
using Graphical Editor(when switching between Design and Source view it is
getting overwritten). IMO, even though attribute order does not matter in
XML programming it is important for better readability as I explained
above. I have seen some users are using Eclipse default XML editor for
programming because of this kind of issues with Graphical Editor. But I
understand the difficulty of fixing this issue with available XML
processing libraries. So if possible we can give a try to fix this[1]. WDYT?

[1] https://wso2.org/jira/browse/DEVTOOLESB-374

Thanks,
Rajeevan

On Fri, Jun 10, 2016 at 1:00 AM, Susinda Perera  wrote:

> Hi Rajeevan
>
> I have google a bit on this issue in general. It seems like normal DOM
> does not care about the attribute order. Also I believe xml schemas would
> also not care about the order[1]. We have to test this whether we have any
> support in axiom level. As this requirement is valid in terms of end user,
> please create a JIRA to track this. Kavith is looking at some other xml
> processing library, may be he can hive some input.
>
> [1] - https://www.w3.org/TR/REC-xml/#sec-starttags
>
> On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan <
> rajeev...@wso2.com> wrote:
>
>> Hi,
>>
>> I will explain the issue with the help of Property Mediator. When we are
>> adding a property with an expression to a sequence in Graphical Editor, the
>> source view for that mediator is as follows,
>>
>> >   name="TestProperty" xmlns:m0="http://services.samples;
>> xmlns:m1=" http://services.samples/xsd "/>
>>
>> Here 'expression' is positioned before 'name' of the mediator. IMHO,
>> 'name' should be positioned before 'expression'(for better readability) and
>> we should try to keep the order as below(from ESB Doc),
>>
>> > "literal" | expression="xpath") [scope=default|transport|axis2|axis2-client]
>> [pattern="regex" [group="integer"]]>
>> ?
>> 
>>
>> So I tried to change it from source view but when I switching between
>> graphical and source views my changes are removed and ordered by
>> alphabetically. It is giving difficulties when we are using Graphical
>> Editor and trying to keep some conventions.
>> It should be a known issue. Will we be able to fix this?
>>
>> Appreciate your thoughts on this.
>>
>> --
>> Vimalanathan Rajeevan
>> Software Engineer,
>> WSO2, Inc. *http://wso2.com* 
>> Lean.Enterprise.Middleware
>>
>> Mobile:
>> *+94 773090875 <%2B94%20773090875>*
>> LinkedIn:
>> *https://www.linkedin.com/in/RajeevanVimalanathan
>> *
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Susinda Perera*
> Software Engineer
> B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL)
> Mobile:(+94)716049075
> Blog: susinda.blogspot.com
> WSO2 Inc. http://wso2.com/
> Tel : 94 11 214 5345 Fax :94 11 2145300
>
>


-- 
Vimalanathan Rajeevan
Software Engineer,
WSO2, Inc. *http://wso2.com* 
Lean.Enterprise.Middleware

Mobile:
*+94 773090875*
LinkedIn:
*https://www.linkedin.com/in/RajeevanVimalanathan
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Susinda Perera
Hi Rajeevan

I have google a bit on this issue in general. It seems like normal DOM does
not care about the attribute order. Also I believe xml schemas would also
not care about the order[1]. We have to test this whether we have any
support in axiom level. As this requirement is valid in terms of end user,
please create a JIRA to track this. Kavith is looking at some other xml
processing library, may be he can hive some input.

[1] - https://www.w3.org/TR/REC-xml/#sec-starttags

On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan 
wrote:

> Hi,
>
> I will explain the issue with the help of Property Mediator. When we are
> adding a property with an expression to a sequence in Graphical Editor, the
> source view for that mediator is as follows,
>
>name="TestProperty" xmlns:m0="http://services.samples;
> xmlns:m1=" http://services.samples/xsd "/>
>
> Here 'expression' is positioned before 'name' of the mediator. IMHO,
> 'name' should be positioned before 'expression'(for better readability) and
> we should try to keep the order as below(from ESB Doc),
>
>  "literal" | expression="xpath") [scope=default|transport|axis2|axis2-client]
> [pattern="regex" [group="integer"]]>
> ?
> 
>
> So I tried to change it from source view but when I switching between
> graphical and source views my changes are removed and ordered by
> alphabetically. It is giving difficulties when we are using Graphical
> Editor and trying to keep some conventions.
> It should be a known issue. Will we be able to fix this?
>
> Appreciate your thoughts on this.
>
> --
> Vimalanathan Rajeevan
> Software Engineer,
> WSO2, Inc. *http://wso2.com* 
> Lean.Enterprise.Middleware
>
> Mobile:
> *+94 773090875 <%2B94%20773090875>*
> LinkedIn:
> *https://www.linkedin.com/in/RajeevanVimalanathan
> *
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Susinda Perera*
Software Engineer
B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL)
Mobile:(+94)716049075
Blog: susinda.blogspot.com
WSO2 Inc. http://wso2.com/
Tel : 94 11 214 5345 Fax :94 11 2145300
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-09 Thread Nuwan Pallewela
Hi Rajeevan,

This behavior happens when we try to format the configuration. We use javax
DocumentBuilder to parse and format and it does not care about the
attribute order, since it's meaningless as far as the standard is
concerned.
This for sure we can fix by manually editing the source configuration but
the concern is it will need some considerable effort to do so. Will it be
worth to spend that much time to fix this now because this is an non
blocking issue and we haven't got any complains about this from customers?
Anyways I think it is better to open a JIRA and keep it to be fixed in a
future.

Thanks,
Nuwan

On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan 
wrote:

> Hi,
>
> I will explain the issue with the help of Property Mediator. When we are
> adding a property with an expression to a sequence in Graphical Editor, the
> source view for that mediator is as follows,
>
>name="TestProperty" xmlns:m0="http://services.samples;
> xmlns:m1=" http://services.samples/xsd "/>
>
> Here 'expression' is positioned before 'name' of the mediator. IMHO,
> 'name' should be positioned before 'expression'(for better readability) and
> we should try to keep the order as below(from ESB Doc),
>
>  "literal" | expression="xpath") [scope=default|transport|axis2|axis2-client]
> [pattern="regex" [group="integer"]]>
> ?
> 
>
> So I tried to change it from source view but when I switching between
> graphical and source views my changes are removed and ordered by
> alphabetically. It is giving difficulties when we are using Graphical
> Editor and trying to keep some conventions.
> It should be a known issue. Will we be able to fix this?
>
> Appreciate your thoughts on this.
>
> --
> Vimalanathan Rajeevan
> Software Engineer,
> WSO2, Inc. *http://wso2.com* 
> Lean.Enterprise.Middleware
>
> Mobile:
> *+94 773090875 <%2B94%20773090875>*
> LinkedIn:
> *https://www.linkedin.com/in/RajeevanVimalanathan
> *
>



-- 
--

*Nuwan Chamara Pallewela*


*Software Engineer*

*WSO2, Inc. *http://wso2.com
*lean . enterprise . middleware*

Email   *nuw...@wso2.com *
Mobile  *+94719079739@*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev