MIS Systems Thread, commandreporter XML inconsistency in Technical; We are running SIMS commandreporter successfully to generate csv data out of SIMS.
However, we are aware that it would ...
22nd October 2012, 09:17 PM #1
23rd October 2012, 02:22 PM #2
The _x0020_ is the UTF value for a space when the xml docuemt is parsed as XML element names can't have spaces
'_' is the escape character and 'x0020' is the UTF code for space, kind of like in HTML
Info below here System.Xml.XmlConvert Class
public static string EncodeName(string name);
Converts a name to a valid XML name.
A String specifying the name to be encoded.
A String containing the XML name. If name is null or System.String.Empty, name is returned.
This method translates invalid characters, such as spaces or half-width Katakana, that need to be mapped to XML names without the support or presence of schemas. The invalid characters are translated into escaped numeric entity encodings.
The escape character is '_'. Any XML name character that does not conform to the W3C Extensible Markup Language (XML) 1.0 specification is escaped as _xHHHH_. The HHHH string stands for the four-digit hexadecimal UCS-2 code for the character in most significant bit first order. For example, the name "Order Details" is encoded as "Order_x0020_Details".
The underscore character does not need to be escaped unless it is followed by a character sequence that together with the underscore can be misinterpreted as an escape sequence when decoding the name. No short forms are encoded. For example, the forms "_x20_" and "__" are not encoded.
This method guarantees the name is valid according to the XML specification. It allows colons in any position, which means the name might still be invalid according to the W3C Namespace Specification (Namespaces in XML 1.0 (Third Edition)). To guarantee it is a valid namespace qualified name use the System.Xml.XmlConvert.EncodeLocalName(System.Strin g) method for the prefix and local name parts and join the result with a colon.
See the System.Xml.XmlConvert.EncodeLocalName(System.Strin g) method for an example comparing the System.Xml.XmlConvert.EncodeLocalName(System.Strin g), System.Xml.XmlConvert.EncodeName(System.String), and System.Xml.XmlConvert.EncodeNmToken(System.String) methods.
System.Xml.XmlConvert Class, System.Xml Namespace
23rd October 2012, 09:33 PM #3
- Rep Power
Thanks for that XML reference - we recognised the x0020 as 32 = space from the old ASCII days - and UTF equivalent.
The escape sequence makes sense.
What is still a puzzle is why SIMS generates the report one way manually (without escape sequence, but with a caption in the schema), and fully with escape sequence via commandreporter.
Will have another go at paramdef in case there is a setting in there to force one or the other, unless someone else already knows and can help out here.
27th March 2013, 10:45 AM #4
- Rep Power
Originally Posted by bede
I'm having the exact same problem.
Did you find a solution to this?
Thanks in anticipation,
27th March 2013, 11:17 AM #5
- Rep Power
No we did not find a solution in the end, sorry.
We wrote some python to process the xml as it stands ignoring the extra info. Not as elegant but did the job.
Then of course the goalposts changed and so we have not pursued it.
Paramdef did not appear to have a bearing as far as we could understand it in the timeframe we had.
27th March 2013, 11:23 AM #6
I don't know why SIMS does this, but I can confirm that CommandReporter is consistent (i.e. whatever field names it gives you, it will always give you).
Paramdef is useful for reports that contain filters, you can set default values in SIMS, run CommandReporter with PARAMDEF switch and edit the resulting XML to edit the filters (you pass the PARAMDEF XML as an argument to CommandReporter.
There's a good thread about CR and PARAMDEF here: CLR /Params String
By rpycroft in forum Windows
Last Post: 8th December 2007, 11:55 AM
Last Post: 2nd November 2007, 08:45 PM
By Craig_W in forum ICT KS3 SATS Tests
Last Post: 17th May 2007, 07:49 AM
By TechMonkey in forum Web Development
Last Post: 2nd February 2007, 12:40 PM
By kingswood in forum MIS Systems
Last Post: 8th June 2006, 10:28 AM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread