Indigo Rose Software
  #1  
Old 09-01-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
Cross-Eyed XML

I've been throught this XML file way too many times now and cannot find the error in it. Everything seems okay, but AMS (5 & 6) give me errors when loading it for the actions.

If anyone has a moment to take a look, I'd appreciate the extra eyes
Code:
<ActionTemplates>
   <Action>
      <Name>DateDiff.AddDays</Name>
      <Description>Adds the specified number of days to the date.</Description>
      <ReturnValueType>string</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>The date to be added to.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Days</Name>
            <Description>The number of days to add.</Description>
            <Type>number</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>10</Default>
               <DataType>number</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.AddMonths</Name>
      <Description>Adds the specified number of months to the date.</Description>
      <ReturnValueType>string</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>The date to be added to.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Months</Name>
            <Description>The number of months to add.</Description>
            <Type>number</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>10</Default>
               <DataType>number</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.AddYears</Name>
      <Description>Adds the specified number of years to the date.</Description>
      <ReturnValueType>string</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>The date to be added to.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Years</Name>
            <Description>The number of years to add.</Description>
            <Type>number</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>10</Default>
               <DataType>number</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.FormatSeconds</Name>
      <Description>formats seconds into a string HH:MM:SS.</Description>
      <ReturnValueType>number</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Seconds</Name>
            <Description>The number of seconds to format.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>3661</Default>
               <DataType>number</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.GetDayOfWeek</Name>
      <Description>returns a numeric representation of the day of the week.</Description>
      <ReturnValueType>number</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>The date to return the day of the week for.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.IsEqual</Name>
      <Description>Compares Date1 with Date2</Description>
      <ReturnValueType>boolean</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date1</Name>
            <Description>first date in the expression.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Date2</Name>
            <Description>second date in the expression.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/25/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.IsGreaterThan</Name>
      <Description>Compares Date1 with Date2.</Description>
      <ReturnValueType>boolean</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date1</Name>
            <Description>first date in the expression.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Date2</Name>
            <Description>second date in the expression.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/25/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.IsLessThan</Name>
      <Description>Compares Date1 with Date2.</Description>
      <ReturnValueType>boolean</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date1</Name>
            <Description>first date in the expression.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Date2</Name>
            <Description>second date in the expression.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/25/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.IsValid</Name>
      <Description>check to see if the date is valid</Description>
      <ReturnValueType>boolean</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>the date to check for validity.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.SubtractDays</Name>
      <Description>Subtract the specified number of days from the date.</Description>
      <ReturnValueType>string</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>The date to be subracted from.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Days</Name>
            <Description>The number of days to subtract.</Description>
            <Type>number</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>10</Default>
               <DataType>number</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
   <Action>
      <Name>DateDiff.SubtractMonths</Name>
      <Description>Subtracts the specified number of months from the date.</Description>
      <ReturnValueType>string</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>The date to be subtracted from.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Months</Name>
            <Description>The number of months to subtract.</Description>
            <Type>number</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>10</Default>
               <DataType>number</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>   
   <Action>
      <Name>DateDiff.SubtractYears</Name>
      <Description>Subtracts the specified number of years from the date.</Description>
      <ReturnValueType>string</ReturnValueType>
      <Arguments>
         <Arg>
            <Name>Date</Name>
            <Description>The date to be subtracted from.</Description>
            <Type>string</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>"01/01/2005"</Default>
               <DataType>string</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
         <Arg>
            <Name>Years</Name>
            <Description>The number of years to subtract.</Description>
            <Type>number</Type>
            <Default/>
            <Required>1</Required>
            <EasyMode>
               <Default>10</Default>
               <DataType>number</DataType>
               <Constraints>none</Constraints>
            </EasyMode>
         </Arg>
      </Arguments>
   </Action>
</ActionTemplates>
Reply With Quote
  #2  
Old 09-01-2005
bnkrazy's Avatar
bnkrazy bnkrazy is offline
Forum Member
 
Join Date: Oct 2003
Location: Richmond, VA
Posts: 143
Ran it through the validator: http://www.w3schools.com/dom/dom_validate.asp

and it said it was fine...

I introduced a malformed tag and it caught it...so I assume the validator is working correctly...

btw...the validator only works in IE
Reply With Quote
  #3  
Old 09-01-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
I tried that too with the same results, but once the file is compiled into my plugin, AMS doesn't like it. Also the error message indicates it's not getting the name of my plugin properly. But, like I said, if I take the last 2 actions out of my XML, everything loads and works fine.

All the actions still work, but the XML is hosed somewhere...
Attached Images
File Type: jpg XMLError.JPG (8.0 KB, 20 views)
Reply With Quote
  #4  
Old 09-01-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
Okay, I don't think it's the XML.

I droped the XML file into the Data\Actions folder and AMS reads it from there without any errors. So... the question is why does it error when reading it as a resource?
Reply With Quote
  #5  
Old 09-01-2005
Brett's Avatar
Brett Brett is offline
Indigo Rose Staff Member
 
Join Date: Jan 2000
Posts: 2,001
Worm,

I have run into this before. I bet it is the irPlg_GetPluginActionXML function in the DLL. For example, the Clipboard plugin's function looks like this:

Code:
#define SIZE_XML_STRING 10000

char szXML[SIZE_XML_STRING];

//  stuff...

int irPlg_GetPluginActionXML(char* szBuffer, int* pnBufferSize)
{
	memset(szXML,0,10000);
	if(!IR_PLUGIN_GetTextFromResourceFile("TEXTFILE",IDR_ACTIONSXML,szXML,SIZE_XML_STRING))
	{
		lstrcpy(szXML,"");
	}

	int nLength = lstrlen(szXML);
	if(*pnBufferSize < nLength)
	{
		*pnBufferSize = nLength;
		return -1;
	} else
	{
		memset(szBuffer,0,*pnBufferSize);
		lstrcpy(szBuffer,szXML);
		return nLength;
	}
}
My guess is that your XML is larger than the string is allocated for. Try changing this:

#define SIZE_XML_STRING 10000

to:

#define SIZE_XML_STRING 100000

(or whatever size you want)

And then change:

memset(szXML,0,10000);

to be:

memset(szXML,0,SIZE_XML_STRING);

I am not sure of your code, but that is probably the problem.
Reply With Quote
  #6  
Old 09-01-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
That did it. Thanks Brett

You don't even want to know how much time I spent pouring over that XML file. Sheesh!
Reply With Quote
  #7  
Old 09-01-2005
Brett's Avatar
Brett Brett is offline
Indigo Rose Staff Member
 
Join Date: Jan 2000
Posts: 2,001
Been there. Done that. Bought the shirt.
Reply With Quote
  #8  
Old 09-01-2005
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
Is it a one size fits all? If so, can I borrow it
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML format TJ_Tigger AutoPlay Media Studio 5.0 6 10-04-2005 01:47 PM
Need help. How to add element to XML??? dmla AutoPlay Media Studio 5.0 5 11-10-2004 03:05 AM
XML plugin Project example - XML Weather from weather.com kpsmith AutoPlay Media Studio 5.0 8 06-03-2004 06:25 PM
Spotlight: XML Actions Plugin Desmond AutoPlay Media Studio 5.0 1 03-15-2004 04:56 PM
Using XML Or INI files during install djpyne Setup Factory 6.0 0 10-15-2003 11:55 AM


All times are GMT -6. The time now is 08:12 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software