Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using XML to solve the problem of hard coding XML path of key

LISY
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2021

HI,

I'm trying to solve the problem of hard coding. Using XML to solve it,but Path problems occurred when used after successful deployment

1 answer

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2021

I am sorry I can't work out what you are asking in your question.

What is "the problem of hard coding"?  The usual mention of hard-coding being a problem is that you want to make your code more flexible so it can deal with variable inputs instead of a hard-coded list.  The "problem" there is fixed by, well, not using hard coding.

So, without a definition of what the problem is, the rest of your question makes no sense.  Using XML is not a fix for not doing hard-coding, you've not explained "path problems" and "successful deployment" is completely out of context.

Could you explain the problem you are having in detail please?

LISY
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2021

I need to take the key out of my code and put it in an XML file, and I put that XML file in RESOURCE, how do I write the path to access that file in my code.

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 16, 2021

Ok, so you're getting rid of hard-coding by reading data from xml instead of putting it in the code.  That's a good approach to de-hard-coding stuff.

But it does leave us a bit stuck.  We're here to talk about Atlassian stuff, and there's nothing in your question about how it relates to Atlassian stuff, so we may be the wrong audience.  Also, you haven't said what you're trying to achieve, or the technologies you're using.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events