Page 1 of 1

XML Editor PHP tags excluding

Posted: Thu Jun 13, 2013 8:41 am
by martin.dufka
it would be nice, if Spket XML Editor excludes <?php all inside ?> from parsing. Now it generates errors and formatter does not work correctly:


Multiple markers at this line
- Missing closing
quote
- Missing closing tag
- Missing '>'

Code: Select all

<link rel="stylesheet" type="text/css" href="<?php echo $extDir; ?>/file1.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl; ?>/file2.css" />
is formatted as:

Code: Select all

<link rel="stylesheet" type="text/css" href="<?php echo $extDir; ?>/file1.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl; ?>/file2.css" />

Re: XML Editor PHP tags excluding

Posted: Thu Jun 13, 2013 8:48 am
by martin.dufka
... eclipse plugin spket 1.6.23

Re: XML Editor PHP tags excluding

Posted: Thu Jun 13, 2013 3:26 pm
by eric_suen
Maybe you need a PHP editor? I'm not sure XML editor should handle this issue.

Re: XML Editor PHP tags excluding

Posted: Fri Jun 14, 2013 12:37 am
by martin.dufka
php editor's formatter usually does not format xml code very well and there are mostly small pieces of php code in xml template file then oppositely, I think.

I have an (may be stupid) idea, if would be doable, substitute simply all "<?" to "LTQUESTION" and "?>" to "QUESTIONGT" strings temporarily before parsing and formatting.

It would be nice especially in such like cases:

Code: Select all

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        
		<link rel="stylesheet" type="text/css" href="<?php echo $this->extDir; ?>/resources/css/ext-all-gray.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/styles/e4.css" />

        
		<script type="text/javascript" src="<?php echo $this->extDir; ?>/ext-all<?php echo $this->debug ?>.js"></script>

		<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/file4.js"></script>
		<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/file5.js"></script>
	</head>
	<body>
		<?php echo $this->getBody() ?>
	</body>
</html>

Re: XML Editor PHP tags excluding

Posted: Fri Jun 14, 2013 4:44 pm
by eric_suen
Download http://www.agpad.com/downloads/com.spket.xml_1.6.19.jar and replace the old one, also you need modify your eclipse.ini(spket.ini if you were using standalone version)

Before

Code: Select all

-vmargs
-Xms40m
-Xmx512m
After

Code: Select all

-vmargs
-Xms40m
-Xmx512m
-Dcom.spket.xml.checkPHPTag=true

Re: XML Editor PHP tags excluding

Posted: Sat Jun 15, 2013 10:33 am
by martin.dufka
Thanx for a quick update. I tested this and there is only one problem, what I see. The data part is changed by formatter, if tag "<?" is there.

Code: Select all

        <script type="text/javascript">
            Ext.Loader.setConfig({
                enabled : true,
                paths:{
                    'Ext'   : '<?php echo $extDir; ?>/src',
                    'Ext.ux': '<?php echo $uxDir; ?>'
                }
            });
        </script>
to:

Code: Select all

        <script type="text/javascript">
            Ext.Loader.setConfig({
                enabled : true,
                paths:{
            'Ext'   : '<?php echo $extDir; ?>/src',
            'Ext.ux': '<?php echo $uxDir; ?>'
                }
            });
        </script>

I tested this in both cases: if "convert tabs to spaces" checked and unchecked too with the same result.

Re: XML Editor PHP tags excluding

Posted: Mon Jun 17, 2013 8:00 am
by eric_suen
Fixed, please download http://www.agpad.com/downloads/com.spket.xml_1.6.19.jar and try again.

Re: XML Editor PHP tags excluding

Posted: Thu Jun 12, 2014 12:49 am
by martin.dufka
Does not work in kepler eclipse after upgrade from indigo
: (

Re: XML Editor PHP tags excluding

Posted: Thu Jun 12, 2014 8:02 am
by eric_suen
You need download http://www.agpad.com/downloads/com.spket.xml_1.6.19.jar and replace the old one, seems the change hasn't commit to the release version.