Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Aug 27, 2007 7:27 am   

[2.01] XML export
 
When I try to export something to XML, it ends up with errors in it.

</trigger>
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


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

Required white space was missing.


I can view it in the editor just fine though.
Reply with quote
sabman
Novice


Joined: 17 Aug 2007
Posts: 34

PostPosted: Mon Aug 27, 2007 5:39 pm   
 
I just exported XML for another bug I had.

Perhaps you can get a bit more detailed. What specifically are you trying to export? Can you export one class but not another? Are you trying to export the entire thing?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Aug 27, 2007 5:45 pm   
 
Having the pkg file is really the only way to reproduce this bug. I'm guessing it's related to a specific setting or corruption in your package.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Aug 27, 2007 7:21 pm   
 
Where are you getting the error:
Quote:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

That's not any error message in CMUD that I am aware of. Are you trying to load the XML file into some sort of external XML editor? You'll need to post a lot more detail on this. Might also help to post the contents of the XML file that has the error.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Mon Aug 27, 2007 9:04 pm   
 
I didn't have a problem with exporting, but I did with importing. Clicked on Import XML, selected the file, and nothing. Even tried with a blank character.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Aug 27, 2007 10:59 pm   
 
Right. It will export fine, but you won't be able to import it due to the error.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Aug 27, 2007 11:06 pm   
 
Can you give us a copy of the XML so we can try to reproduce the bug?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Aug 27, 2007 11:14 pm   
 
Well I didn't want to display all my code for the world to see, since it specific to a certain mud and my character. Do you want me to e-mail it?
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Aug 27, 2007 11:34 pm   
 
Zugg wrote:
Where are you getting the error:
Quote:
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

That's not any error message in CMUD that I am aware of. Are you trying to load the XML file into some sort of external XML editor? You'll need to post a lot more detail on this. Might also help to post the contents of the XML file that has the error.


Just trying to view it with IE. You can view the mudconnector XML document just fine with no errors as an example.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Tue Aug 28, 2007 1:28 am   
 
I have to get more info about certain things. When you select a module in the package editor, it gives you tabs for Options and XML. Is this XML supposed to be editable? If so, could this may be part the problem because I can add XML lines to it, but when I go to save it it reverts back to the original xml.

Just in case, here is a sample xml output I got.

Code:
<?xml version="1.0" encoding="UTF-8" ?>
<cmud>
<window name="Imperian" usesession="false" packages="English Keypad|English Directions|Imperian">
  <uid>{8D30F7A5-CCC4-41C2-9BEB-8848A46F21FC}</uid>  <class name="System"></class>
  <alias name="t">
    <value>target=%1;#ECHO Target is now: @target</value>
  </alias>
  <alias name="bash">
    <value>blade slash @target
blade slash @target
kickflip @target</value>
  </alias>
  <var name="target">gruarg</var>
  <macro key="CTRL-KEY5">
    <value>bash</value>
  </macro>
  <macro key="CTRL-KEY7">
    <value>drink health</value>
  </macro>
  <macro key="CTRL-KEY9">
    <value>drink health</value>
  </macro>
  <trigger priority="810">
    <pattern>You cannot move that fast, slow down!</pattern>
    <value>#NODIR</value>
  </trigger>
  <alias name="pb">
    <value>put %1 %2 in backpack</value>
  </alias>
  <alias name="gb">
    <value>get %1 %2 from backpack</value>
  </alias>
  <trigger priority="870">
    <pattern>Enter an option or enter your character's name.</pattern>
    <value>AAAAA</value>
  </trigger>
  <trigger priority="880">
    <pattern>What is your password~?</pattern>
    <value>AAAAA</value>
  </trigger>

</window>
</cmud>


The AAAAA is to be sure no one logs on to me of course.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Aug 29, 2007 8:01 pm   
 
Yes, this XML is editable. When I edit it and click Save changes, it works fine here. Perhaps you can show exactly what text you are adding or editing that isn't saving.

OldGuy2: I have no idea why IE doesn't display the XML properly. As far as I can tell, it is standard XML, so maybe it's an IE issue.

If you have an XML file that does not import, please email it to me so I can test it.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Thu Aug 30, 2007 10:53 am   
 
Code:
<window name="Imperian" usesession="false" packages="English Keypad|English Directions|Imperian">
  <uid>{8D30F7A5-CCC4-41C2-9BEB-8848A46F21FC}</uid>  <class name="System" id="5"></class>
  <alias name="t" id="8">
    <value>target=%1;#ECHO Target is now: @target</value>
  </alias>
  <alias name="bash" id="9">
    <value>blade slash @target
blade slash @target
kickflip @target</value>
  </alias>
  <var name="target" id="10">lumberjack</var>
  <macro key="CTRL-KEY5" id="65">
    <value>bash</value>
  </macro>
  <macro key="CTRL-KEY7" id="66">
    <value>drink health</value>
  </macro>
  <trigger priority="810" id="81">
    <pattern>You cannot move that fast, slow down!</pattern>
    <value>#NODIR</value>
  </trigger>
  <alias name="pb" id="82">
    <value>put %1 %2 in backpack</value>
  </alias>
  <alias name="gb" id="83">
    <value>get %1 %2 from backpack</value>
  </alias>
  <trigger priority="3710" id="371">
    <pattern>There is no exit in that direction.</pattern>
    <value>#NODIR</value>
  </trigger>

</window>


Adding this:
Code:
  <macro key="CTRL-KEY9" id="9999">
    <value>jump</value>
  </macro>


Then I hit 'Save changes' and presto, the added section is no longer there and the setting is not created.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Aug 30, 2007 12:31 pm   
 
This may only be slightly related, but I'm wondering if it might be required (or just a good idea) to use CDATA tags on script code in the XML. I know it wouldn't look as clean, but it could make the XML output more compliant.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Aug 30, 2007 5:46 pm   
 
CDATA has nothing to do with "compliance". CMUD is already converting special characters like < into proper entities like &lt; So CDATA isn't needed. Since I allow the XML to be edited, I decided that CDATA made the XML look "less readable". And remember that the entire purpose of all of this XML work was to come up with a more human-readable XML format.

Also, this encoding (where entities are used), is also the same encoding that is used in zApp, so when the zApp user-defined forms stuff is added later, there will be consistency on how it looks to the user.
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Fri Aug 31, 2007 2:18 am   
 
Not to feel too rushed or anything, but have you had any success with reproducing the issue with XML not saving/being imported correctly?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Aug 31, 2007 11:48 am   
 
Fair enough. If we know how to use CDATA tags and try them in the CMUD XML, would they work? Just curious now. Smile
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Aug 31, 2007 4:42 pm   
 
Yes, if you use CDATA, then they should work fine.

Dumas: I still haven't gotten to this import/export bug on my bug list yet. Hopefully later today.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Sep 07, 2007 7:10 pm   
 
The problem with editing the XML above was that you were specifying an ID="999" value for your macro. Since there wasn't any existing record with an ID of 999, it ignored your addition. You need to use ID="-1" to add a new value.

I have improved this in v2.03 so that if the ID you specify doesn't exist, it will still create a new value. So that should work in 2.03.

Also, in 2.03, if the length of the "encoded" script is a lot longer than the original script (because of lots of < > & etc), then CMUD will use a CDATA section instead of doing the encoding.

And I should have the XML export/import issues working later today.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net