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:
- First, $paramArray[0] 'Dog hates cats' is inputted and retrieved from client.
- Second, using the above argument scheme xml stored on server, retrieve the 1st premise: "$paramArray[0] is true in this situation".
- 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.
- Finally I want to send 'Dog hates cat is true in this situation'from PHP back to the user.