简体   繁体   English

有人知道XML序列化Key = Value的这种格式吗?

[英]Does anyone know this format of XML serialization Key=Value?

From the source of HTML page I'm able to retrieve traces in the next format: 从HTML页面的源代码中,我可以用以下格式检索跟踪:

{LIST_EXCLUDED=[],LIST_TEST={HIGHLIGHTING_COLOR=#000000,TEST_HIERARCHY=5,COLOR=#E7E7B5,TEST_NAME=TEST,SHORT_NAME=TEST,COLOR_NAME=CUSTOM},TEST_BOUND=[{LIST_TESTS=[{LSA_DEBUG_INFO={FIRST_TEST_NUMBER=3,RBD=T},TEST_ID=0,NUMBER_OF_LAST_ACTIONS=9}]}],TEST_REC_ID=171}

It looks pretty like JSON format but a bit different. 它看起来很像JSON格式,但是有些不同。 I need to parse this value and to search it for the values that are needed. 我需要解析该值并在其中搜索所需的值。 Does anyone know if it's a kind of standard structure or specific parses need to be written in this case? 有谁知道在这种情况下是否需要编写标准结构或特定的语法分析?

As far as I didn't get any answer about standard libraries that can be used in this case I had to convert this data into JSON. 就我在这种情况下无法获得的关于标准库的任何答复而言,我不得不将此数据转换为JSON。
I've used next replaces: 我使用了下一个替换:

// key=value
parsedDataMap = parsedDataMap.replaceAll("([,\\{\\[]{1})([^,\\{\\[=]+)=([^,\\{\\}\\[\\]]+)([,\\}\\]]{1})",
    "$1\"$2\":\"$3\"$4");
// key=value 2nd time because some of the values were missed 1st time because of intersection of ranges
parsedDataMap = parsedDataMap.replaceAll("([,\\{\\[]{1})([^\",\\{\\[=]+)=([^\",\\{\\}\\[\\]]+)([,\\}\\]]{1})",
    "$1\"$2\":\"$3\"$4");
// key=[ or key={
parsedDataMap = parsedDataMap.replaceAll("([,\\{\\[]{1})([^,\\{\\[=]+)=([\\[\\{])", "$1\"$2\":$3");
// key=[ or key={ 2nd time because some of the values were missed 1st time because of intersection of ranges
parsedDataMap = parsedDataMap.replaceAll("([,\\{\\[]{1})([^\",\\{\\[=]+)=([\\[\\{])", "$1\"$2\":$3");

如果字符串中没有'=',则将'='替换为':',然后像处理json一样

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有谁知道如何提取我的日期字符串并更改格式? - Does anyone know how extract my date string & change the format? 有谁知道如何使用 JNI-Registry (com.ice.jni.registry) 为密钥设置默认注册表值? - Does anyone know how to set the default registry value for a key using JNI-Registry (com.ice.jni.registry)? 键/值对的哪种序列化格式最好在RDBMS中建立索引? - Which serialization format for key/value pairs is best indexable in RDBMS? 将对象保存为XML格式还是序列化? - Save an object to XML format or with serialization? 有谁知道这个“LookAndFeel”的名字吗? - Does anyone know the name of this “LookAndFeel”? 有谁知道如何在Spring Security oauth2中更改响应错误格式? - Does anyone know how to change response error format in Spring security oauth2? 有谁知道是否有一个eclipse插件可以指出pom.xml中不兼容的jar? - Does anyone know if there is an eclipse plugin can point out incompatible jars in pom.xml? Jackson 中键/值对的序列化? - Serialization of key/value pairs in Jackson? 有谁知道如何向org.w3c.dom.Element添加值以实例化MiningSchema和SupportVectorMachineModel? - Does anyone know how to add a value to org.w3c.dom.Element to instantiate both MiningSchema and SupportVectorMachineModel? 当我将其设置为变量时,它会更改值。 有谁知道为什么? - When I set this to a variable, it changes the value. Does anyone know why?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM