Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Modifying XDP File as an XML Using XPath

Avatar

14-10-2008

Hello,<br /><br />I have a requirement, in which I need to have form which has got pre-populated elements and some manual-entry elements. These forms will be designed/maintained by Business users. So at the time of Designing the forms, they bound only the pre-populated elements to the Schema, and not the manual-entry fields. There are lot of manual entry elements on the form. <br /><br />For manual entry fields, I created a program which adds bindings for manual entry elements programattically using XPath expressions. <br /><br />Somehow when I add "<bind>" tags, XDP layout is getting changed and also some junk characters are getting added. <br /><br />Please someone comment on the above approach whether it is good to programmatically modify the XDP file or not. And also is there any way to avoid the issues. <br /><br />Thanks in advance.<br />Sivajee.

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

15-10-2008

There is nothing technically wrong with your approach - although you really have to know what you are doing when you modify the XDP. Why can't the business users do the binding in the Designer ....wouldn't that be easier (and safer).

Avatar

15-10-2008

Thanks Paul for responding to me.



The forms which we have, got a lot of manual fields. To speed up the process of form-design and ease the business-users task, we opted the modifying XDP programatically.



But still I am getting that error-messages when trying to save the modified XDP. Did anyone faced similar issues? Please comment on this.



Regards

Sivajee.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

15-10-2008

Very few people will modify the native XDP ...you must be writing out the tags incorrectly. If you look at the XDP in XMLSpy it should tell you if the XML is well formed. Then try and open it in Designer and it will tell you which line of the XDP is causing the issue.

Avatar

15-10-2008

Yes I already did that, when I opened the file in XMLSpy, I got a popup saying that the file has got offending characters <br />(0xA0),<squaresymbol>(0x90). XMLSpy need to do an automatic replacement of those characters, in order to open the file. <br /><br />Think I am doing something wrong during saving of the modified document into new File. What I am doing is, after the modification of the XML Document, I am converting into String and then writing the String content to the File. <br /><br />I will explore on the option of directly writing the modified Document content to the file, instead of String conversion. If this doesn't help then do I left with anyother options?<br /><br />Sivajee

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

15-10-2008

Looks like your program is adding control chars to the XDP.

Avatar

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct Reply

0 solutions
View profile

Avatar
Level 6
neptas
Level 6

Likes

0 likes

Total Posts

259 posts

Correct Reply

0 solutions
View profile
neptas
Level 6

22-10-2008

aspratap,



did you solved this?



Thank you

Avatar

22-10-2008

Yes.



This is how I solved it:



Earlier what I did was, converted the modified XDP document to a String and then wrote that string to the File.



I fixed it by directly writing the modified document to the file instead of converting into String and then writing to File.



Thank you.