XML Editor PHP tags excluding

Feature requests
Post Reply
martin.dufka
Posts: 12
Joined: Sun Jan 10, 2010 7:10 pm

XML Editor PHP tags excluding

Post by martin.dufka » Thu Jun 13, 2013 8:41 am

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" />

martin.dufka
Posts: 12
Joined: Sun Jan 10, 2010 7:10 pm

Re: XML Editor PHP tags excluding

Post by martin.dufka » Thu Jun 13, 2013 8:48 am

... eclipse plugin spket 1.6.23

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: XML Editor PHP tags excluding

Post by eric_suen » Thu Jun 13, 2013 3:26 pm

Maybe you need a PHP editor? I'm not sure XML editor should handle this issue.

martin.dufka
Posts: 12
Joined: Sun Jan 10, 2010 7:10 pm

Re: XML Editor PHP tags excluding

Post by martin.dufka » Fri Jun 14, 2013 12:37 am

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>

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: XML Editor PHP tags excluding

Post by eric_suen » Fri Jun 14, 2013 4:44 pm

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

martin.dufka
Posts: 12
Joined: Sun Jan 10, 2010 7:10 pm

Re: XML Editor PHP tags excluding

Post by martin.dufka » Sat Jun 15, 2013 10:33 am

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.

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: XML Editor PHP tags excluding

Post by eric_suen » Mon Jun 17, 2013 8:00 am

Fixed, please download http://www.agpad.com/downloads/com.spket.xml_1.6.19.jar and try again.

martin.dufka
Posts: 12
Joined: Sun Jan 10, 2010 7:10 pm

Re: XML Editor PHP tags excluding

Post by martin.dufka » Thu Jun 12, 2014 12:49 am

Does not work in kepler eclipse after upgrade from indigo
: (

eric_suen
Site Admin
Posts: 678
Joined: Wed Sep 28, 2005 7:00 am
Contact:

Re: XML Editor PHP tags excluding

Post by eric_suen » Thu Jun 12, 2014 8:02 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests