[TYPO3-project-formidable] phpedit: highlight php code in xml file

Asbjørn Morell atmorell at gmail.com
Fri May 25 17:04:21 CEST 2007


Hello,

If any of you guys are using phpedit http://www.waterproof.fr/ with 
formidable xml files this might interrest you: (see below)

Best regards.
Asbjørn Morell.


http://www.waterproof.fr/support/forums/viewtopic.php?t=2105
--------------------------------------------------------------------------------
Hey

I got some xml documents that contain php scripts:

<![CDATA[

$var = "this is php"


]]>

Can phpedit be figured to swtich to php inside thoose tags? That would be so 
awsome!

best regards.
Asbjørn Morell.
--------------------------------------------------------------------------------

As far as I am aware this isn't currently possible. But the idea I suggested 
here to allow you to rewrite what PHPEdit interprits from what the file 
contents actaully are. In this case you could make it rewrite the 
"<![CDATA[" bits to "<?php" and PHPEdit would then highlight it as PHP.
_________________

Bastien Hofmann

--------------------------------------------------------------------------------

Hi,

Actually this is already possible, but you have to get your hands dirty

You need to modify some xml configuration files in the PHPEdit install dir:
First, "Extensions\PHPLanguage\php.xml", you need to add these lines in the 
"<SavageBranchings>" tag:
Code:

    <SavageBranching pattern="&lt;![CDATA[">
       <SourceLanguage>XML</SourceLanguage>
    </SavageBranching>



Then in "Extensions\XMLLanguage\xml.xml", you need to add this block:
Code:

  <SavageBranchings>
    <SavageBranching pattern="]]&gt;">
       <SourceLanguage>PHP</SourceLanguage>
    </SavageBranching>
  </SavageBranchings>



Then the code in the CDATA section will be considered as PHP in every XML 
document. There might be some glitches since it wasn't designed to handle 
this, but it should still help you

You can make a copy of the 2 files you modified in you profile directory to 
keep them when you import your settings from on version of PHPEdit to an 
other: copy "Extensions\PHPLanguage\php.xml" to "C:\Documents and 
Settings\<<user name>>\Application 
Data\WaterProof\PHPEdit\2.10\ExtensionsData\PHPLanguage\php.xml" and 
"Extensions\XMLLanguage\xml.xml" to "C:\Documents and Settings\<<user 
name>>\Application 
Data\WaterProof\PHPEdit\2.10\ExtensionsData\XMLLanguage\xml.xml".


atmorell

--------------------------------------------------------------------------------

Bastien Hofmann,

thank you! works great ))))

Best regards.
Asbjørn Morell.




More information about the TYPO3-project-formidable mailing list