Passing XML in html

C

CSharper

Hi All,

Sorry it is not the correct forum but all time I get my answers here
so I thought I ask here and please forgive me.

Is it possible to create a hidden variable in html form and populate
xml data in it and submit it? I am just wondering since XML can have
special characters that could break the post or is there a html tag
that I can use to store xml data itself?

Thanks,
 
A

Arne Vajhøj

CSharper said:
Sorry it is not the correct forum but all time I get my answers here
so I thought I ask here and please forgive me.

So forums with competent people get more off topic posts ...

:)
Is it possible to create a hidden variable in html form and populate
xml data in it and submit it? I am just wondering since XML can have
special characters that could break the post or is there a html tag
that I can use to store xml data itself?

I think the easy approach would be to store the XML in Base64 encoding
in the hidden field.

That will prevent all types of problems.

It does cost a little bit in encoding and decoding plus added size,
but I would expect it to be insignificant.

Arne
 
C

CSharper

So forums with competent people get more off topic posts ...

:)


I think the easy approach would be to store the XML in Base64 encoding
in the hidden field.

That will prevent all types of problems.

It does cost a little bit in encoding and decoding plus added size,
but I would expect it to be insignificant.

Arne
Thanks a lot and always appriciate the help.
 
C

CSharper

So forums with competent people get more off topic posts ...

:)


I think the easy approach would be to store the XML in Base64 encoding
in the hidden field.

That will prevent all types of problems.

It does cost a little bit in encoding and decoding plus added size,
but I would expect it to be insignificant.

Arne

Is it possible to give me simple example html tag how would it look
like?
Thanks,
 
A

Arne Vajhøj

CSharper said:
Is it possible to give me simple example html tag how would it look
like?

The syntax for hidden fields are completely standard:

<input type="hidden" name="foobar" value="xxxxxxxxxxxxxxxxxxxxxxxx"/>

You just need to put the value in as base64.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top