drmg17928 2016-01-28 14:18
浏览 21

具有可替换PHP变量的XML

I have a question regarding my use of XML. I am using XML as a data storage repositiory. I wanted to use XML to store sentences with variables, inside elements are variables (php) that will be replaced later on by php values/variables once it is retrieved.

I was wondering whether this is the correct use of XML with dynamic variable? Or is there another option to store this kind of data?

Below is an example:

<argument-scheme    
    xmlns:xsi="http://www.w3.org/2001/XMLSchema"
    xmlns:schemaLocation="G:\EasyPHP-DevServer-14.1VC11\data\localweb\argupedia\frontend\arg-scheme-repository\arg-scheme.xsd"
    id='0'
    name='Argument from Sign'
>
    <premise> $paramArray[0] is true in this situation.</premise>
    <premise> $paramArray[1] is generally indicated as true when its sign, $paramArray[0] is true, in this kind of situation."</premise>
    <conclusion>Therefore, $paramArray[1] is true in this situation.</conclusion>
    <critical-question>"Is the correlation between " . $paramArray[0] .  " and " . $paramArray[1] . "strong?"</critical-question>
    <critical-question>Is $paramArray[0] the only event that reliably account for $paramArray[1] ?</critical-question>
    <param-name>Sign</param-name>
    <param-name>Conclusion</param-name>
    <param-question>What is the observation?</param-question>
    <param-question>What is the conclusion that can be drawn from the observation</param-question>
</argument-scheme>

Here is an example of how xml is used:

  1. First, $paramArray[0] 'Dog hates cats' is inputted and retrieved from client.
  2. Second, using the above argument scheme xml stored on server, retrieve the 1st premise: "$paramArray[0] is true in this situation".
  3. Third, I want to compose the premise in PHP: 'Dog hates cat is true in this situation' by replacing '$paramArray[0]' in xml with the user input $paramArray[0] = 'Dog hates cat' using php regex.
  4. Finally I want to send 'Dog hates cat is true in this situation'from PHP back to the user.
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100