hexadecimal entity are converted into string while loading XML data into marklogic server please suggest the right solution for this. without using XLST charmap
There is now way to to this automatically.
In xquery in order to have hexadecimal show up you need to use the &# then the x like this
"©"
You could write a function that looks at the content that your loading in and finds all the hexadecimal already in there and converts them to this format.
Related
I am newbie to xquery and MarkLogic. I wanted to know if there is any generalised method to convert an EBCDIC format file to ASCII file or any way that would help ?
Content loaded into MarkLogic is always transcoded to UTF-8. You can specify the encoding of the source on an option to the function you use read the source:
xdmp:document-load("/path/to/my.xml",
<options xmlns="xdmp:document-load">
<encoding>ebcdic-cp-us</encoding>
</options>
)
The specific supported encodings are from ICU, do you can look them up at theICU page here.
If you want to return this back out as ASCII, you need to specify that in the output options. This could be on a specific API (e.g. xdmp:save) or as general rendering options for a query or for all queries on an appserver.
I am using Visual Foxpro 9, I want to print Unicode chars in report (frx).
There are some ways to extend report listener to show unicode. I need the code to extend/show reportListner to show unicode.
I've never had to work with Unicode within VFP either, or spent any time working with Reports, but the Help for the Render method of the ReportListener does mention Unicode:
cContentsToBeRendered
Indicates the text to be rendered for Expression (Field) and Label layout elements.
For Picture layout elements sourced from a file, cContentsToBeRendered contains the filename.
When specifying a filename for an image, ReportListener provides cContentsToBeRendered
as a DBCS string, which is the standard format for strings in Visual FoxPro.
However, when indicating text to be rendered, ReportListener provides
cContentsToBeRendered as a Unicode string, appropriately translated to the correct
locale using any regional script information associated with this layout control in
its report definition file (frx) record.
If your derived class sends the text value through some additional processing, such as
storage in a table, you can use the STRCONV() function, and its optional regional
script parameter, to convert the string to DBCS first. For more information, see
STRCONV( ) Function.
Although I could be incorrect, but I believe VFP does NOT support UniCode and only works with the base ASCII character set. But then again, I've never needed to use Unicode either and have used FoxPro since the beginning of its lifetime.
I would imagine Rick Strahl's article Using Unicode in Visual FoxPro
Web and Desktop Applications would be fairly definitive on the topic.
I am using RapidXML to read an XML file, parse it, do some operation and write it back.
Any text written in quotes within tag, is printed with quotes in expanded form.
Is there any flag that will prevent expansion of quotes and other special characters.
Any suggestion is welcomed.
I don't believe this will work. Writing the XML is unrelated to how it was created, and changing the parse flags would not affect it.
The whole point of printing XML DOM is to create a well-formed XML that can later be parsed; therefore, I wouldn't expect an XML library to have such an option.
If you want such functionality, you can easily write one by changing the function copy_and_expand_chars in rapidxml_print.hpp
You probably need to turn off entity translation during parsing. Can you try by setting the parse_no_entity_translation flag during parsing?
I wish to know how to convert the byte array file to a file in a string format and display it in a webpage. Can anyone tell me how can i perform this?
Unsure of what your actual aim is, a good place to start investigating would be the System.Text.Encoding class
http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx
I am returning 12345678910111213171819 from java to flex, with in xml tags using http serivce. The result format is object.
but when I display the text it automatically converted or treated as number
so it displays like 1.234567891011121317181 x e^21 ....
How to avoid this?
Thanks in advance.
Regards,
Sankara narayanan Ekambaranathan.
Can't you simply coerce it with String()?
var returnedObject:String = String(123463457695);
Well the easiest solution is just a little workaround to the issue:
Instead of sending the open data like
12345678910111213171819
Convert the data into Base 64 Encoding While transmitting
MTIzNDU2Nzg5MTAxMTEyMTMxNzE4MTk=
In Flex Convert back the data using the standard Base 64 Decoder provided with flex
to convert it back into String instead of number format during XML parsing ;)
I faced the same problem on one of my projects.
After a lot of googling and investigation I fixed it by changing result format to XML and manually parsing the XML with explicit type conversions.
Another (actually, more correct) way is to define a schema for the response and somehow apply it to the XML decoder but I haven't found an easy way to do it.